vue-files-preview-inno
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
1 lines • 2.18 kB
Source Map (JSON)
{"version":3,"file":"newline.mjs","sources":["../../../../../../node_modules/markdown-it/lib/rules_inline/newline.mjs"],"sourcesContent":["// Proceess '\\n'\n\nimport { isSpace } from '../common/utils.mjs'\n\nexport default function newline (state, silent) {\n let pos = state.pos\n\n if (state.src.charCodeAt(pos) !== 0x0A/* \\n */) { return false }\n\n const pmax = state.pending.length - 1\n const max = state.posMax\n\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {\n // Find whitespaces tail of pending chars.\n let ws = pmax - 1\n while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--\n\n state.pending = state.pending.slice(0, ws)\n state.push('hardbreak', 'br', 0)\n } else {\n state.pending = state.pending.slice(0, -1)\n state.push('softbreak', 'br', 0)\n }\n } else {\n state.push('softbreak', 'br', 0)\n }\n }\n\n pos++\n\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++ }\n\n state.pos = pos\n return true\n}\n"],"names":["newline","state","silent","pos","pmax","max","ws","isSpace"],"mappings":";AAIe,SAASA,EAASC,GAAOC,GAAQ;AAC9C,MAAIC,IAAMF,EAAM;AAEhB,MAAIA,EAAM,IAAI,WAAWE,CAAG,MAAM;AAAgB,WAAO;AAEzD,QAAMC,IAAOH,EAAM,QAAQ,SAAS,GAC9BI,IAAMJ,EAAM;AAMlB,MAAI,CAACC;AACH,QAAIE,KAAQ,KAAKH,EAAM,QAAQ,WAAWG,CAAI,MAAM;AAClD,UAAIA,KAAQ,KAAKH,EAAM,QAAQ,WAAWG,IAAO,CAAC,MAAM,IAAM;AAE5D,YAAIE,IAAKF,IAAO;AAChB,eAAOE,KAAM,KAAKL,EAAM,QAAQ,WAAWK,IAAK,CAAC,MAAM,KAAM,CAAAA;AAE7D,QAAAL,EAAM,UAAUA,EAAM,QAAQ,MAAM,GAAGK,CAAE,GACzCL,EAAM,KAAK,aAAa,MAAM,CAAC;AAAA,MACjC;AACE,QAAAA,EAAM,UAAUA,EAAM,QAAQ,MAAM,GAAG,EAAE,GACzCA,EAAM,KAAK,aAAa,MAAM,CAAC;AAAA;AAGjC,MAAAA,EAAM,KAAK,aAAa,MAAM,CAAC;AAOnC,OAHAE,KAGOA,IAAME,KAAOE,EAAQN,EAAM,IAAI,WAAWE,CAAG,CAAC;AAAK,IAAAA;AAE1D,SAAAF,EAAM,MAAME,GACL;AACT;","x_google_ignoreList":[0]}