1 |
- {"ast":null,"code":"// Proceess '\\n'\n\nimport { isSpace } from '../common/utils.mjs';\nexport default function newline(state, silent) {\n let pos = state.pos;\n if (state.src.charCodeAt(pos) !== 0x0A /* \\n */) {\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 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 pos++;\n\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) {\n pos++;\n }\n state.pos = pos;\n return true;\n}","map":{"version":3,"names":["isSpace","newline","state","silent","pos","src","charCodeAt","pmax","pending","length","max","posMax","ws","slice","push"],"sources":["F:/workspace/202226701027/huinongbao-app/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"],"mappings":"AAAA;;AAEA,SAASA,OAAO,QAAQ,qBAAqB;AAE7C,eAAe,SAASC,OAAOA,CAAEC,KAAK,EAAEC,MAAM,EAAE;EAC9C,IAAIC,GAAG,GAAGF,KAAK,CAACE,GAAG;EAEnB,IAAIF,KAAK,CAACG,GAAG,CAACC,UAAU,CAACF,GAAG,CAAC,KAAK,IAAI,WAAU;IAAE,OAAO,KAAK;EAAC;EAE/D,MAAMG,IAAI,GAAGL,KAAK,CAACM,OAAO,CAACC,MAAM,GAAG,CAAC;EACrC,MAAMC,GAAG,GAAGR,KAAK,CAACS,MAAM;;EAExB;EACA;EACA;EACA;EACA,IAAI,CAACR,MAAM,EAAE;IACX,IAAII,IAAI,IAAI,CAAC,IAAIL,KAAK,CAACM,OAAO,CAACF,UAAU,CAACC,IAAI,CAAC,KAAK,IAAI,EAAE;MACxD,IAAIA,IAAI,IAAI,CAAC,IAAIL,KAAK,CAACM,OAAO,CAACF,UAAU,CAACC,IAAI,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;QAC5D;QACA,IAAIK,EAAE,GAAGL,IAAI,GAAG,CAAC;QACjB,OAAOK,EAAE,IAAI,CAAC,IAAIV,KAAK,CAACM,OAAO,CAACF,UAAU,CAACM,EAAE,GAAG,CAAC,CAAC,KAAK,IAAI,EAAEA,EAAE,EAAE;QAEjEV,KAAK,CAACM,OAAO,GAAGN,KAAK,CAACM,OAAO,CAACK,KAAK,CAAC,CAAC,EAAED,EAAE,CAAC;QAC1CV,KAAK,CAACY,IAAI,CAAC,WAA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