UNPKG

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.66 kB
{"version":3,"file":"paragraph.mjs","sources":["../../../../../../node_modules/markdown-it/lib/rules_block/paragraph.mjs"],"sourcesContent":["// Paragraph\n\nexport default function paragraph (state, startLine, endLine) {\n const terminatorRules = state.md.block.ruler.getRules('paragraph')\n const oldParentType = state.parentType\n let nextLine = startLine + 1\n state.parentType = 'paragraph'\n\n // jump line-by-line until empty one or EOF\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue }\n\n // Some tags can terminate paragraph without empty line.\n let terminate = false\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true\n break\n }\n }\n if (terminate) { break }\n }\n\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()\n\n state.line = nextLine\n\n const token_o = state.push('paragraph_open', 'p', 1)\n token_o.map = [startLine, state.line]\n\n const token_i = state.push('inline', '', 0)\n token_i.content = content\n token_i.map = [startLine, state.line]\n token_i.children = []\n\n state.push('paragraph_close', 'p', -1)\n\n state.parentType = oldParentType\n\n return true\n}\n"],"names":["paragraph","state","startLine","endLine","terminatorRules","oldParentType","nextLine","terminate","i","l","content","token_o","token_i"],"mappings":"AAEe,SAASA,EAAWC,GAAOC,GAAWC,GAAS;AAC5D,QAAMC,IAAkBH,EAAM,GAAG,MAAM,MAAM,SAAS,WAAW,GAC3DI,IAAgBJ,EAAM;AAC5B,MAAIK,IAAWJ,IAAY;AAI3B,OAHAD,EAAM,aAAa,aAGZK,IAAWH,KAAW,CAACF,EAAM,QAAQK,CAAQ,GAAGA,KAAY;AAMjE,QAHIL,EAAM,OAAOK,CAAQ,IAAIL,EAAM,YAAY,KAG3CA,EAAM,OAAOK,CAAQ,IAAI;AAAK;AAGlC,QAAIC,IAAY;AAChB,aAASC,IAAI,GAAGC,IAAIL,EAAgB,QAAQI,IAAIC,GAAGD;AACjD,UAAIJ,EAAgBI,CAAC,EAAEP,GAAOK,GAAUH,GAAS,EAAI,GAAG;AACtD,QAAAI,IAAY;AACZ;AAAA,MACF;AAEF,QAAIA;AAAa;AAAA,EACnB;AAEA,QAAMG,IAAUT,EAAM,SAASC,GAAWI,GAAUL,EAAM,WAAW,EAAK,EAAE,KAAI;AAEhF,EAAAA,EAAM,OAAOK;AAEb,QAAMK,IAAaV,EAAM,KAAK,kBAAkB,KAAK,CAAC;AACtD,EAAAU,EAAQ,MAAW,CAACT,GAAWD,EAAM,IAAI;AAEzC,QAAMW,IAAaX,EAAM,KAAK,UAAU,IAAI,CAAC;AAC7C,SAAAW,EAAQ,UAAWF,GACnBE,EAAQ,MAAW,CAACV,GAAWD,EAAM,IAAI,GACzCW,EAAQ,WAAW,CAAA,GAEnBX,EAAM,KAAK,mBAAmB,KAAK,EAAE,GAErCA,EAAM,aAAaI,GAEZ;AACT;","x_google_ignoreList":[0]}