pulpweaver4 0.0.0-stage → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ast/djot.d.ts +123 -0
- package/dist/ast/djot.js +458 -0
- package/dist/ast/djot.js.map +1 -0
- package/dist/ast/index.d.ts +10 -0
- package/dist/ast/index.js +11 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/ast/locator.d.ts +27 -0
- package/dist/ast/locator.js +77 -0
- package/dist/ast/locator.js.map +1 -0
- package/dist/ast/nodes.d.ts +534 -0
- package/dist/ast/nodes.js +48 -0
- package/dist/ast/nodes.js.map +1 -0
- package/dist/ast/position.d.ts +88 -0
- package/dist/ast/position.js +98 -0
- package/dist/ast/position.js.map +1 -0
- package/dist/ast/traverse.d.ts +12 -0
- package/dist/ast/traverse.js +37 -0
- package/dist/ast/traverse.js.map +1 -0
- package/dist/bibliography/biblatex.d.ts +13 -0
- package/dist/bibliography/biblatex.js +849 -0
- package/dist/bibliography/biblatex.js.map +1 -0
- package/dist/bibliography/bibtex.d.ts +39 -0
- package/dist/bibliography/bibtex.js +259 -0
- package/dist/bibliography/bibtex.js.map +1 -0
- package/dist/bibliography/csl.d.ts +9 -0
- package/dist/bibliography/csl.js +241 -0
- package/dist/bibliography/csl.js.map +1 -0
- package/dist/bibliography/dates.d.ts +33 -0
- package/dist/bibliography/dates.js +223 -0
- package/dist/bibliography/dates.js.map +1 -0
- package/dist/bibliography/index.d.ts +8 -0
- package/dist/bibliography/index.js +9 -0
- package/dist/bibliography/index.js.map +1 -0
- package/dist/bibliography/item.d.ts +142 -0
- package/dist/bibliography/item.js +181 -0
- package/dist/bibliography/item.js.map +1 -0
- package/dist/bibliography/latex.d.ts +21 -0
- package/dist/bibliography/latex.js +586 -0
- package/dist/bibliography/latex.js.map +1 -0
- package/dist/bibliography/names.d.ts +23 -0
- package/dist/bibliography/names.js +244 -0
- package/dist/bibliography/names.js.map +1 -0
- package/dist/bibliography/read.d.ts +24 -0
- package/dist/bibliography/read.js +50 -0
- package/dist/bibliography/read.js.map +1 -0
- package/dist/citations/book.d.ts +91 -0
- package/dist/citations/book.js +206 -0
- package/dist/citations/book.js.map +1 -0
- package/dist/citations/collect.d.ts +52 -0
- package/dist/citations/collect.js +125 -0
- package/dist/citations/collect.js.map +1 -0
- package/dist/citations/hast.d.ts +12 -0
- package/dist/citations/hast.js +49 -0
- package/dist/citations/hast.js.map +1 -0
- package/dist/citations/index.d.ts +14 -0
- package/dist/citations/index.js +15 -0
- package/dist/citations/index.js.map +1 -0
- package/dist/citations/lint.d.ts +70 -0
- package/dist/citations/lint.js +92 -0
- package/dist/citations/lint.js.map +1 -0
- package/dist/citations/notes.d.ts +11 -0
- package/dist/citations/notes.js +120 -0
- package/dist/citations/notes.js.map +1 -0
- package/dist/citations/positions.d.ts +34 -0
- package/dist/citations/positions.js +90 -0
- package/dist/citations/positions.js.map +1 -0
- package/dist/citations/project.d.ts +7 -0
- package/dist/citations/project.js +24 -0
- package/dist/citations/project.js.map +1 -0
- package/dist/colour/cmyk.d.ts +71 -0
- package/dist/colour/cmyk.js +210 -0
- package/dist/colour/cmyk.js.map +1 -0
- package/dist/colour/images.d.ts +36 -0
- package/dist/colour/images.js +106 -0
- package/dist/colour/images.js.map +1 -0
- package/dist/colour/index.d.ts +7 -0
- package/dist/colour/index.js +8 -0
- package/dist/colour/index.js.map +1 -0
- package/dist/colour/ink-limit.d.ts +68 -0
- package/dist/colour/ink-limit.js +109 -0
- package/dist/colour/ink-limit.js.map +1 -0
- package/dist/colour/intents.d.ts +135 -0
- package/dist/colour/intents.js +183 -0
- package/dist/colour/intents.js.map +1 -0
- package/dist/colour/lcms.d.ts +79 -0
- package/dist/colour/lcms.js +229 -0
- package/dist/colour/lcms.js.map +1 -0
- package/dist/colour/previews.d.ts +49 -0
- package/dist/colour/previews.js +116 -0
- package/dist/colour/previews.js.map +1 -0
- package/dist/colour/wasm/LICENSE-lcms2 +22 -0
- package/dist/colour/wasm/lcms2.wasm +0 -0
- package/dist/config/config.d.ts +109 -0
- package/dist/config/config.js +295 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/page.d.ts +42 -0
- package/dist/config/page.js +95 -0
- package/dist/config/page.js.map +1 -0
- package/dist/config/project-schema.d.ts +23 -0
- package/dist/config/project-schema.js +209 -0
- package/dist/config/project-schema.js.map +1 -0
- package/dist/config/schema.d.ts +68 -0
- package/dist/config/schema.js +333 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/toml.d.ts +54 -0
- package/dist/config/toml.js +238 -0
- package/dist/config/toml.js.map +1 -0
- package/dist/contents/index.d.ts +8 -0
- package/dist/contents/index.js +9 -0
- package/dist/contents/index.js.map +1 -0
- package/dist/contents/transform.d.ts +64 -0
- package/dist/contents/transform.js +149 -0
- package/dist/contents/transform.js.map +1 -0
- package/dist/csl/affix.d.ts +16 -0
- package/dist/csl/affix.js +74 -0
- package/dist/csl/affix.js.map +1 -0
- package/dist/csl/data/chicago-author-date.d.ts +2 -0
- package/dist/csl/data/chicago-author-date.js +3 -0
- package/dist/csl/data/chicago-author-date.js.map +1 -0
- package/dist/csl/data/chicago-notes-bibliography.d.ts +2 -0
- package/dist/csl/data/chicago-notes-bibliography.js +3 -0
- package/dist/csl/data/chicago-notes-bibliography.js.map +1 -0
- package/dist/csl/data/locales-en-GB.d.ts +2 -0
- package/dist/csl/data/locales-en-GB.js +3 -0
- package/dist/csl/data/locales-en-GB.js.map +1 -0
- package/dist/csl/data/locales-en-US.d.ts +2 -0
- package/dist/csl/data/locales-en-US.js +3 -0
- package/dist/csl/data/locales-en-US.js.map +1 -0
- package/dist/csl/dates.d.ts +30 -0
- package/dist/csl/dates.js +223 -0
- package/dist/csl/dates.js.map +1 -0
- package/dist/csl/format.d.ts +29 -0
- package/dist/csl/format.js +157 -0
- package/dist/csl/format.js.map +1 -0
- package/dist/csl/index.d.ts +26 -0
- package/dist/csl/index.js +16 -0
- package/dist/csl/index.js.map +1 -0
- package/dist/csl/ir.d.ts +103 -0
- package/dist/csl/ir.js +549 -0
- package/dist/csl/ir.js.map +1 -0
- package/dist/csl/load.d.ts +98 -0
- package/dist/csl/load.js +163 -0
- package/dist/csl/load.js.map +1 -0
- package/dist/csl/locale.d.ts +90 -0
- package/dist/csl/locale.js +251 -0
- package/dist/csl/locale.js.map +1 -0
- package/dist/csl/names.d.ts +41 -0
- package/dist/csl/names.js +203 -0
- package/dist/csl/names.js.map +1 -0
- package/dist/csl/numbers.d.ts +48 -0
- package/dist/csl/numbers.js +170 -0
- package/dist/csl/numbers.js.map +1 -0
- package/dist/csl/processor.d.ts +177 -0
- package/dist/csl/processor.js +759 -0
- package/dist/csl/processor.js.map +1 -0
- package/dist/csl/project.d.ts +21 -0
- package/dist/csl/project.js +78 -0
- package/dist/csl/project.js.map +1 -0
- package/dist/csl/render.d.ts +130 -0
- package/dist/csl/render.js +748 -0
- package/dist/csl/render.js.map +1 -0
- package/dist/csl/style.d.ts +168 -0
- package/dist/csl/style.js +262 -0
- package/dist/csl/style.js.map +1 -0
- package/dist/csl/xml.d.ts +28 -0
- package/dist/csl/xml.js +162 -0
- package/dist/csl/xml.js.map +1 -0
- package/dist/djot/djot.js/LICENSE +20 -0
- package/dist/djot/djot.js/src/ast.d.ts +324 -0
- package/dist/djot/djot.js/src/ast.js +61 -0
- package/dist/djot/djot.js/src/ast.js.map +1 -0
- package/dist/djot/djot.js/src/attributes.d.ts +31 -0
- package/dist/djot/djot.js/src/attributes.js +300 -0
- package/dist/djot/djot.js/src/attributes.js.map +1 -0
- package/dist/djot/djot.js/src/block.d.ts +87 -0
- package/dist/djot/djot.js/src/block.js +1201 -0
- package/dist/djot/djot.js/src/block.js.map +1 -0
- package/dist/djot/djot.js/src/djot-renderer.d.ts +8 -0
- package/dist/djot/djot.js/src/djot-renderer.js +755 -0
- package/dist/djot/djot.js/src/djot-renderer.js.map +1 -0
- package/dist/djot/djot.js/src/event.d.ts +6 -0
- package/dist/djot/djot.js/src/event.js +2 -0
- package/dist/djot/djot.js/src/event.js.map +1 -0
- package/dist/djot/djot.js/src/filter.d.ts +13 -0
- package/dist/djot/djot.js/src/filter.js +159 -0
- package/dist/djot/djot.js/src/filter.js.map +1 -0
- package/dist/djot/djot.js/src/find.d.ts +7 -0
- package/dist/djot/djot.js/src/find.js +33 -0
- package/dist/djot/djot.js/src/find.js.map +1 -0
- package/dist/djot/djot.js/src/html.d.ts +40 -0
- package/dist/djot/djot.js/src/html.js +656 -0
- package/dist/djot/djot.js/src/html.js.map +1 -0
- package/dist/djot/djot.js/src/index.d.ts +9 -0
- package/dist/djot/djot.js/src/index.js +9 -0
- package/dist/djot/djot.js/src/index.js.map +1 -0
- package/dist/djot/djot.js/src/inline.d.ts +62 -0
- package/dist/djot/djot.js/src/inline.js +1019 -0
- package/dist/djot/djot.js/src/inline.js.map +1 -0
- package/dist/djot/djot.js/src/options.d.ts +13 -0
- package/dist/djot/djot.js/src/options.js +27 -0
- package/dist/djot/djot.js/src/options.js.map +1 -0
- package/dist/djot/djot.js/src/pandoc.d.ts +20 -0
- package/dist/djot/djot.js/src/pandoc.js +1040 -0
- package/dist/djot/djot.js/src/pandoc.js.map +1 -0
- package/dist/djot/djot.js/src/parse.d.ts +19 -0
- package/dist/djot/djot.js/src/parse.js +1436 -0
- package/dist/djot/djot.js/src/parse.js.map +1 -0
- package/dist/djot/djot.js/src/version.d.ts +1 -0
- package/dist/djot/djot.js/src/version.js +2 -0
- package/dist/djot/djot.js/src/version.js.map +1 -0
- package/dist/djot/index.d.ts +5 -0
- package/dist/djot/index.js +6 -0
- package/dist/djot/index.js.map +1 -0
- package/dist/djot/read.d.ts +57 -0
- package/dist/djot/read.js +146 -0
- package/dist/djot/read.js.map +1 -0
- package/dist/fonts/css.d.ts +82 -0
- package/dist/fonts/css.js +329 -0
- package/dist/fonts/css.js.map +1 -0
- package/dist/fonts/faces.d.ts +101 -0
- package/dist/fonts/faces.js +226 -0
- package/dist/fonts/faces.js.map +1 -0
- package/dist/fonts/index.d.ts +12 -0
- package/dist/fonts/index.js +13 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/lint.d.ts +58 -0
- package/dist/fonts/lint.js +209 -0
- package/dist/fonts/lint.js.map +1 -0
- package/dist/fonts/match.d.ts +36 -0
- package/dist/fonts/match.js +104 -0
- package/dist/fonts/match.js.map +1 -0
- package/dist/fonts/names.d.ts +9 -0
- package/dist/fonts/names.js +50 -0
- package/dist/fonts/names.js.map +1 -0
- package/dist/fonts/subset.d.ts +72 -0
- package/dist/fonts/subset.js +169 -0
- package/dist/fonts/subset.js.map +1 -0
- package/dist/fonts/walk.d.ts +33 -0
- package/dist/fonts/walk.js +120 -0
- package/dist/fonts/walk.js.map +1 -0
- package/dist/fonts/wasm/LICENSE-harfbuzzjs +19 -0
- package/dist/fonts/wasm/harfbuzz-subset.wasm +0 -0
- package/dist/html/check.d.ts +62 -0
- package/dist/html/check.js +186 -0
- package/dist/html/check.js.map +1 -0
- package/dist/html/counters.d.ts +32 -0
- package/dist/html/counters.js +72 -0
- package/dist/html/counters.js.map +1 -0
- package/dist/html/css.d.ts +33 -0
- package/dist/html/css.js +72 -0
- package/dist/html/css.js.map +1 -0
- package/dist/html/dom.d.ts +28 -0
- package/dist/html/dom.js +162 -0
- package/dist/html/dom.js.map +1 -0
- package/dist/html/editions.d.ts +26 -0
- package/dist/html/editions.js +57 -0
- package/dist/html/editions.js.map +1 -0
- package/dist/html/images.d.ts +13 -0
- package/dist/html/images.js +62 -0
- package/dist/html/images.js.map +1 -0
- package/dist/html/index.d.ts +14 -0
- package/dist/html/index.js +15 -0
- package/dist/html/index.js.map +1 -0
- package/dist/html/registry.d.ts +120 -0
- package/dist/html/registry.js +48 -0
- package/dist/html/registry.js.map +1 -0
- package/dist/html/render.d.ts +99 -0
- package/dist/html/render.js +687 -0
- package/dist/html/render.js.map +1 -0
- package/dist/hyphenation/NOTICE +429 -0
- package/dist/hyphenation/exceptions.d.ts +60 -0
- package/dist/hyphenation/exceptions.js +79 -0
- package/dist/hyphenation/exceptions.js.map +1 -0
- package/dist/hyphenation/hyphenator.d.ts +66 -0
- package/dist/hyphenation/hyphenator.js +245 -0
- package/dist/hyphenation/hyphenator.js.map +1 -0
- package/dist/hyphenation/index.d.ts +4 -0
- package/dist/hyphenation/index.js +5 -0
- package/dist/hyphenation/index.js.map +1 -0
- package/dist/hyphenation/languages.d.ts +20 -0
- package/dist/hyphenation/languages.js +75 -0
- package/dist/hyphenation/languages.js.map +1 -0
- package/dist/hyphenation/patterns/af.wasm +0 -0
- package/dist/hyphenation/patterns/as.wasm +0 -0
- package/dist/hyphenation/patterns/be.wasm +0 -0
- package/dist/hyphenation/patterns/bg.wasm +0 -0
- package/dist/hyphenation/patterns/bn.wasm +0 -0
- package/dist/hyphenation/patterns/ca.wasm +0 -0
- package/dist/hyphenation/patterns/cy.wasm +0 -0
- package/dist/hyphenation/patterns/da.wasm +0 -0
- package/dist/hyphenation/patterns/de.wasm +0 -0
- package/dist/hyphenation/patterns/el-monoton.wasm +0 -0
- package/dist/hyphenation/patterns/el-polyton.wasm +0 -0
- package/dist/hyphenation/patterns/en-gb.wasm +0 -0
- package/dist/hyphenation/patterns/en-us.wasm +0 -0
- package/dist/hyphenation/patterns/eo.wasm +0 -0
- package/dist/hyphenation/patterns/es.wasm +0 -0
- package/dist/hyphenation/patterns/et.wasm +0 -0
- package/dist/hyphenation/patterns/eu.wasm +0 -0
- package/dist/hyphenation/patterns/fi-x-school.wasm +0 -0
- package/dist/hyphenation/patterns/fr.wasm +0 -0
- package/dist/hyphenation/patterns/fur.wasm +0 -0
- package/dist/hyphenation/patterns/ga.wasm +0 -0
- package/dist/hyphenation/patterns/gl.wasm +0 -0
- package/dist/hyphenation/patterns/gu.wasm +0 -0
- package/dist/hyphenation/patterns/hi.wasm +0 -0
- package/dist/hyphenation/patterns/hr.wasm +0 -0
- package/dist/hyphenation/patterns/hsb.wasm +0 -0
- package/dist/hyphenation/patterns/ia.wasm +0 -0
- package/dist/hyphenation/patterns/is.wasm +0 -0
- package/dist/hyphenation/patterns/it.wasm +0 -0
- package/dist/hyphenation/patterns/ka.wasm +0 -0
- package/dist/hyphenation/patterns/kmr.wasm +0 -0
- package/dist/hyphenation/patterns/kn.wasm +0 -0
- package/dist/hyphenation/patterns/la.wasm +0 -0
- package/dist/hyphenation/patterns/lt.wasm +0 -0
- package/dist/hyphenation/patterns/ml.wasm +0 -0
- package/dist/hyphenation/patterns/mn-cyrl.wasm +0 -0
- package/dist/hyphenation/patterns/mr.wasm +0 -0
- package/dist/hyphenation/patterns/nb.wasm +0 -0
- package/dist/hyphenation/patterns/nl.wasm +0 -0
- package/dist/hyphenation/patterns/nn.wasm +0 -0
- package/dist/hyphenation/patterns/no.wasm +0 -0
- package/dist/hyphenation/patterns/oc.wasm +0 -0
- package/dist/hyphenation/patterns/or.wasm +0 -0
- package/dist/hyphenation/patterns/pa.wasm +0 -0
- package/dist/hyphenation/patterns/pi.wasm +0 -0
- package/dist/hyphenation/patterns/pl.wasm +0 -0
- package/dist/hyphenation/patterns/pms.wasm +0 -0
- package/dist/hyphenation/patterns/pt.wasm +0 -0
- package/dist/hyphenation/patterns/rm.wasm +0 -0
- package/dist/hyphenation/patterns/ru.wasm +0 -0
- package/dist/hyphenation/patterns/sh-cyrl.wasm +0 -0
- package/dist/hyphenation/patterns/sh-latn.wasm +0 -0
- package/dist/hyphenation/patterns/sk.wasm +0 -0
- package/dist/hyphenation/patterns/sl.wasm +0 -0
- package/dist/hyphenation/patterns/sq.wasm +0 -0
- package/dist/hyphenation/patterns/sv.wasm +0 -0
- package/dist/hyphenation/patterns/ta.wasm +0 -0
- package/dist/hyphenation/patterns/te.wasm +0 -0
- package/dist/hyphenation/patterns/th.wasm +0 -0
- package/dist/hyphenation/patterns/tk.wasm +0 -0
- package/dist/hyphenation/patterns/tr.wasm +0 -0
- package/dist/hyphenation/patterns/uk.wasm +0 -0
- package/dist/hyphenation/patterns/zh-latn-pinyin.wasm +0 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes/index.d.ts +10 -0
- package/dist/indexes/index.js +11 -0
- package/dist/indexes/index.js.map +1 -0
- package/dist/indexes/layout.d.ts +30 -0
- package/dist/indexes/layout.js +83 -0
- package/dist/indexes/layout.js.map +1 -0
- package/dist/indexes/locators.d.ts +33 -0
- package/dist/indexes/locators.js +51 -0
- package/dist/indexes/locators.js.map +1 -0
- package/dist/indexes/terms.d.ts +97 -0
- package/dist/indexes/terms.js +211 -0
- package/dist/indexes/terms.js.map +1 -0
- package/dist/indexes/transform.d.ts +90 -0
- package/dist/indexes/transform.js +154 -0
- package/dist/indexes/transform.js.map +1 -0
- package/dist/layout/calibrate.d.ts +12 -0
- package/dist/layout/calibrate.js +50 -0
- package/dist/layout/calibrate.js.map +1 -0
- package/dist/layout/converge.d.ts +31 -0
- package/dist/layout/converge.js +84 -0
- package/dist/layout/converge.js.map +1 -0
- package/dist/layout/counters.d.ts +16 -0
- package/dist/layout/counters.js +62 -0
- package/dist/layout/counters.js.map +1 -0
- package/dist/layout/first-letter.d.ts +34 -0
- package/dist/layout/first-letter.js +183 -0
- package/dist/layout/first-letter.js.map +1 -0
- package/dist/layout/fonts.d.ts +67 -0
- package/dist/layout/fonts.js +110 -0
- package/dist/layout/fonts.js.map +1 -0
- package/dist/layout/generated.d.ts +9 -0
- package/dist/layout/generated.js +83 -0
- package/dist/layout/generated.js.map +1 -0
- package/dist/layout/glue.d.ts +18 -0
- package/dist/layout/glue.js +48 -0
- package/dist/layout/glue.js.map +1 -0
- package/dist/layout/index.d.ts +17 -0
- package/dist/layout/index.js +18 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/lists.d.ts +91 -0
- package/dist/layout/lists.js +1068 -0
- package/dist/layout/lists.js.map +1 -0
- package/dist/layout/margin-boxes.d.ts +114 -0
- package/dist/layout/margin-boxes.js +429 -0
- package/dist/layout/margin-boxes.js.map +1 -0
- package/dist/layout/minipage.d.ts +85 -0
- package/dist/layout/minipage.js +83 -0
- package/dist/layout/minipage.js.map +1 -0
- package/dist/layout/page-box.d.ts +32 -0
- package/dist/layout/page-box.js +110 -0
- package/dist/layout/page-box.js.map +1 -0
- package/dist/layout/page-rules.d.ts +47 -0
- package/dist/layout/page-rules.js +202 -0
- package/dist/layout/page-rules.js.map +1 -0
- package/dist/layout/page.d.ts +51 -0
- package/dist/layout/page.js +133 -0
- package/dist/layout/page.js.map +1 -0
- package/dist/layout/pagebuilder.d.ts +243 -0
- package/dist/layout/pagebuilder.js +591 -0
- package/dist/layout/pagebuilder.js.map +1 -0
- package/dist/layout/pages.d.ts +71 -0
- package/dist/layout/pages.js +741 -0
- package/dist/layout/pages.js.map +1 -0
- package/dist/layout/paragraph.d.ts +194 -0
- package/dist/layout/paragraph.js +1148 -0
- package/dist/layout/paragraph.js.map +1 -0
- package/dist/layout/pre.d.ts +8 -0
- package/dist/layout/pre.js +151 -0
- package/dist/layout/pre.js.map +1 -0
- package/dist/layout/region.d.ts +66 -0
- package/dist/layout/region.js +200 -0
- package/dist/layout/region.js.map +1 -0
- package/dist/layout/vlist.d.ts +218 -0
- package/dist/layout/vlist.js +72 -0
- package/dist/layout/vlist.js.map +1 -0
- package/dist/linebreak/items.d.ts +69 -0
- package/dist/linebreak/items.js +44 -0
- package/dist/linebreak/items.js.map +1 -0
- package/dist/linebreak/knuth-plass.d.ts +149 -0
- package/dist/linebreak/knuth-plass.js +461 -0
- package/dist/linebreak/knuth-plass.js.map +1 -0
- package/dist/lint/config.d.ts +48 -0
- package/dist/lint/config.js +185 -0
- package/dist/lint/config.js.map +1 -0
- package/dist/lint/context.d.ts +64 -0
- package/dist/lint/context.js +37 -0
- package/dist/lint/context.js.map +1 -0
- package/dist/lint/fix.d.ts +40 -0
- package/dist/lint/fix.js +86 -0
- package/dist/lint/fix.js.map +1 -0
- package/dist/lint/index.d.ts +14 -0
- package/dist/lint/index.js +15 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/lint/linter.d.ts +59 -0
- package/dist/lint/linter.js +239 -0
- package/dist/lint/linter.js.map +1 -0
- package/dist/lint/presets.d.ts +20 -0
- package/dist/lint/presets.js +65 -0
- package/dist/lint/presets.js.map +1 -0
- package/dist/lint/project.d.ts +31 -0
- package/dist/lint/project.js +100 -0
- package/dist/lint/project.js.map +1 -0
- package/dist/lint/rules/html.d.ts +30 -0
- package/dist/lint/rules/html.js +163 -0
- package/dist/lint/rules/html.js.map +1 -0
- package/dist/lint/rules/layout.d.ts +42 -0
- package/dist/lint/rules/layout.js +428 -0
- package/dist/lint/rules/layout.js.map +1 -0
- package/dist/lint/rules/source.d.ts +65 -0
- package/dist/lint/rules/source.js +334 -0
- package/dist/lint/rules/source.js.map +1 -0
- package/dist/lint/testing.d.ts +7 -0
- package/dist/lint/testing.js +77 -0
- package/dist/lint/testing.js.map +1 -0
- package/dist/math/hast.d.ts +46 -0
- package/dist/math/hast.js +297 -0
- package/dist/math/hast.js.map +1 -0
- package/dist/math/index.d.ts +9 -0
- package/dist/math/index.js +10 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/mathjax/LICENSE-mathjax +202 -0
- package/dist/math/mathjax/LICENSE-speech-rule-engine +177 -0
- package/dist/math/mathjax/sre/af.json +146 -0
- package/dist/math/mathjax/sre/base.json +140 -0
- package/dist/math/mathjax/sre/ca.json +140 -0
- package/dist/math/mathjax/sre/da.json +140 -0
- package/dist/math/mathjax/sre/de.json +146 -0
- package/dist/math/mathjax/sre/en.json +158 -0
- package/dist/math/mathjax/sre/es.json +140 -0
- package/dist/math/mathjax/sre/euro.json +32 -0
- package/dist/math/mathjax/sre/fr.json +146 -0
- package/dist/math/mathjax/sre/hi.json +146 -0
- package/dist/math/mathjax/sre/it.json +146 -0
- package/dist/math/mathjax/sre/ko.json +146 -0
- package/dist/math/mathjax/sre/nb.json +146 -0
- package/dist/math/mathjax/sre/nemeth.json +125 -0
- package/dist/math/mathjax/sre/nn.json +146 -0
- package/dist/math/mathjax/sre/sv.json +146 -0
- package/dist/math/mathjax/svg/PUA.json +1 -0
- package/dist/math/mathjax/svg/accents-b-i.json +1 -0
- package/dist/math/mathjax/svg/accents.json +1 -0
- package/dist/math/mathjax/svg/arabic.json +1 -0
- package/dist/math/mathjax/svg/arrows.json +1 -0
- package/dist/math/mathjax/svg/braille-d.json +1 -0
- package/dist/math/mathjax/svg/braille.json +1 -0
- package/dist/math/mathjax/svg/calligraphic.json +1 -0
- package/dist/math/mathjax/svg/cherokee.json +1 -0
- package/dist/math/mathjax/svg/cyrillic-ss.json +1 -0
- package/dist/math/mathjax/svg/cyrillic.json +1 -0
- package/dist/math/mathjax/svg/devanagari.json +1 -0
- package/dist/math/mathjax/svg/double-struck.json +1 -0
- package/dist/math/mathjax/svg/fraktur.json +1 -0
- package/dist/math/mathjax/svg/greek-ss.json +1 -0
- package/dist/math/mathjax/svg/greek.json +1 -0
- package/dist/math/mathjax/svg/hebrew.json +1 -0
- package/dist/math/mathjax/svg/latin-b.json +1 -0
- package/dist/math/mathjax/svg/latin-bi.json +1 -0
- package/dist/math/mathjax/svg/latin-i.json +1 -0
- package/dist/math/mathjax/svg/latin.json +1 -0
- package/dist/math/mathjax/svg/marrows.json +1 -0
- package/dist/math/mathjax/svg/math.json +1 -0
- package/dist/math/mathjax/svg/monospace-ex.json +1 -0
- package/dist/math/mathjax/svg/monospace-l.json +1 -0
- package/dist/math/mathjax/svg/monospace.json +1 -0
- package/dist/math/mathjax/svg/mshapes.json +1 -0
- package/dist/math/mathjax/svg/phonetics-ss.json +1 -0
- package/dist/math/mathjax/svg/phonetics.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-b.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-bi.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-ex.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-i.json +1 -0
- package/dist/math/mathjax/svg/sans-serif-r.json +1 -0
- package/dist/math/mathjax/svg/sans-serif.json +1 -0
- package/dist/math/mathjax/svg/script.json +1 -0
- package/dist/math/mathjax/svg/shapes.json +1 -0
- package/dist/math/mathjax/svg/symbols-b-i.json +1 -0
- package/dist/math/mathjax/svg/symbols.json +1 -0
- package/dist/math/mathjax/svg/variants.json +1 -0
- package/dist/math/mathjax.d.ts +67 -0
- package/dist/math/mathjax.js +162 -0
- package/dist/math/mathjax.js.map +1 -0
- package/dist/math/speech.d.ts +27 -0
- package/dist/math/speech.js +87 -0
- package/dist/math/speech.js.map +1 -0
- package/dist/math/typeset.d.ts +75 -0
- package/dist/math/typeset.js +108 -0
- package/dist/math/typeset.js.map +1 -0
- package/dist/measure/css.d.ts +44 -0
- package/dist/measure/css.js +158 -0
- package/dist/measure/css.js.map +1 -0
- package/dist/measure/index.d.ts +3 -0
- package/dist/measure/index.js +4 -0
- package/dist/measure/index.js.map +1 -0
- package/dist/measure/measurer.d.ts +159 -0
- package/dist/measure/measurer.js +300 -0
- package/dist/measure/measurer.js.map +1 -0
- package/dist/measure/model.d.ts +46 -0
- package/dist/measure/model.js +47 -0
- package/dist/measure/model.js.map +1 -0
- package/dist/output/assets.d.ts +10 -0
- package/dist/output/assets.js +65 -0
- package/dist/output/assets.js.map +1 -0
- package/dist/output/index.d.ts +4 -0
- package/dist/output/index.js +5 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/output.d.ts +103 -0
- package/dist/output/output.js +86 -0
- package/dist/output/output.js.map +1 -0
- package/dist/output/stylesheets.d.ts +45 -0
- package/dist/output/stylesheets.js +50 -0
- package/dist/output/stylesheets.js.map +1 -0
- package/dist/paint/backgrounds.d.ts +56 -0
- package/dist/paint/backgrounds.js +261 -0
- package/dist/paint/backgrounds.js.map +1 -0
- package/dist/paint/blend.d.ts +61 -0
- package/dist/paint/blend.js +157 -0
- package/dist/paint/blend.js.map +1 -0
- package/dist/paint/border-image.d.ts +13 -0
- package/dist/paint/border-image.js +149 -0
- package/dist/paint/border-image.js.map +1 -0
- package/dist/paint/borders.d.ts +47 -0
- package/dist/paint/borders.js +329 -0
- package/dist/paint/borders.js.map +1 -0
- package/dist/paint/canvas.d.ts +52 -0
- package/dist/paint/canvas.js +274 -0
- package/dist/paint/canvas.js.map +1 -0
- package/dist/paint/colours.d.ts +55 -0
- package/dist/paint/colours.js +380 -0
- package/dist/paint/colours.js.map +1 -0
- package/dist/paint/columns.d.ts +11 -0
- package/dist/paint/columns.js +42 -0
- package/dist/paint/columns.js.map +1 -0
- package/dist/paint/context.d.ts +47 -0
- package/dist/paint/context.js +2 -0
- package/dist/paint/context.js.map +1 -0
- package/dist/paint/decoration.d.ts +97 -0
- package/dist/paint/decoration.js +280 -0
- package/dist/paint/decoration.js.map +1 -0
- package/dist/paint/effects.d.ts +64 -0
- package/dist/paint/effects.js +342 -0
- package/dist/paint/effects.js.map +1 -0
- package/dist/paint/emphasis.d.ts +13 -0
- package/dist/paint/emphasis.js +95 -0
- package/dist/paint/emphasis.js.map +1 -0
- package/dist/paint/flatten.d.ts +33 -0
- package/dist/paint/flatten.js +968 -0
- package/dist/paint/flatten.js.map +1 -0
- package/dist/paint/geometry.d.ts +62 -0
- package/dist/paint/geometry.js +170 -0
- package/dist/paint/geometry.js.map +1 -0
- package/dist/paint/gradients.d.ts +31 -0
- package/dist/paint/gradients.js +394 -0
- package/dist/paint/gradients.js.map +1 -0
- package/dist/paint/images.d.ts +17 -0
- package/dist/paint/images.js +80 -0
- package/dist/paint/images.js.map +1 -0
- package/dist/paint/lint.d.ts +46 -0
- package/dist/paint/lint.js +105 -0
- package/dist/paint/lint.js.map +1 -0
- package/dist/paint/overprint.d.ts +13 -0
- package/dist/paint/overprint.js +12 -0
- package/dist/paint/overprint.js.map +1 -0
- package/dist/paint/painter.d.ts +92 -0
- package/dist/paint/painter.js +281 -0
- package/dist/paint/painter.js.map +1 -0
- package/dist/paint/path.d.ts +9 -0
- package/dist/paint/path.js +173 -0
- package/dist/paint/path.js.map +1 -0
- package/dist/paint/raster.d.ts +32 -0
- package/dist/paint/raster.js +180 -0
- package/dist/paint/raster.js.map +1 -0
- package/dist/paint/shadows.d.ts +28 -0
- package/dist/paint/shadows.js +104 -0
- package/dist/paint/shadows.js.map +1 -0
- package/dist/paint/sources.d.ts +13 -0
- package/dist/paint/sources.js +17 -0
- package/dist/paint/sources.js.map +1 -0
- package/dist/paint/stacking.d.ts +75 -0
- package/dist/paint/stacking.js +327 -0
- package/dist/paint/stacking.js.map +1 -0
- package/dist/paint/svg-lint.d.ts +57 -0
- package/dist/paint/svg-lint.js +119 -0
- package/dist/paint/svg-lint.js.map +1 -0
- package/dist/paint/svg.d.ts +95 -0
- package/dist/paint/svg.js +728 -0
- package/dist/paint/svg.js.map +1 -0
- package/dist/paint/tables.d.ts +18 -0
- package/dist/paint/tables.js +178 -0
- package/dist/paint/tables.js.map +1 -0
- package/dist/paint/text-shadow.d.ts +26 -0
- package/dist/paint/text-shadow.js +187 -0
- package/dist/paint/text-shadow.js.map +1 -0
- package/dist/paint/text.d.ts +144 -0
- package/dist/paint/text.js +713 -0
- package/dist/paint/text.js.map +1 -0
- package/dist/paint/values.d.ts +24 -0
- package/dist/paint/values.js +160 -0
- package/dist/paint/values.js.map +1 -0
- package/dist/paint/vertical.d.ts +19 -0
- package/dist/paint/vertical.js +236 -0
- package/dist/paint/vertical.js.map +1 -0
- package/dist/pdf/index.d.ts +6 -0
- package/dist/pdf/index.js +7 -0
- package/dist/pdf/index.js.map +1 -0
- package/dist/pdf/pdfx.d.ts +30 -0
- package/dist/pdf/pdfx.js +18 -0
- package/dist/pdf/pdfx.js.map +1 -0
- package/dist/pdf/structure/index.d.ts +53 -0
- package/dist/pdf/structure/index.js +52 -0
- package/dist/pdf/structure/index.js.map +1 -0
- package/dist/pdf/structure/labels.d.ts +16 -0
- package/dist/pdf/structure/labels.js +45 -0
- package/dist/pdf/structure/labels.js.map +1 -0
- package/dist/pdf/structure/links.d.ts +49 -0
- package/dist/pdf/structure/links.js +136 -0
- package/dist/pdf/structure/links.js.map +1 -0
- package/dist/pdf/structure/tags.d.ts +79 -0
- package/dist/pdf/structure/tags.js +314 -0
- package/dist/pdf/structure/tags.js.map +1 -0
- package/dist/pdf/types.d.ts +534 -0
- package/dist/pdf/types.js +16 -0
- package/dist/pdf/types.js.map +1 -0
- package/dist/pdf/wasm/pulpweaver4_pdf.d.ts +41 -0
- package/dist/pdf/wasm/pulpweaver4_pdf.js +286 -0
- package/dist/pdf/wasm/pulpweaver4_pdf_bg.wasm +0 -0
- package/dist/pdf/writer.d.ts +41 -0
- package/dist/pdf/writer.js +78 -0
- package/dist/pdf/writer.js.map +1 -0
- package/dist/plugin/attributes.d.ts +10 -0
- package/dist/plugin/attributes.js +63 -0
- package/dist/plugin/attributes.js.map +1 -0
- package/dist/plugin/define.d.ts +425 -0
- package/dist/plugin/define.js +311 -0
- package/dist/plugin/define.js.map +1 -0
- package/dist/plugin/failure.d.ts +80 -0
- package/dist/plugin/failure.js +97 -0
- package/dist/plugin/failure.js.map +1 -0
- package/dist/plugin/index.d.ts +11 -0
- package/dist/plugin/index.js +12 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/load.d.ts +105 -0
- package/dist/plugin/load.js +197 -0
- package/dist/plugin/load.js.map +1 -0
- package/dist/plugin/register.d.ts +166 -0
- package/dist/plugin/register.js +306 -0
- package/dist/plugin/register.js.map +1 -0
- package/dist/plugin/render.d.ts +4 -0
- package/dist/plugin/render.js +28 -0
- package/dist/plugin/render.js.map +1 -0
- package/dist/preflight/index.d.ts +3 -0
- package/dist/preflight/index.js +4 -0
- package/dist/preflight/index.js.map +1 -0
- package/dist/preflight/pdfx.d.ts +440 -0
- package/dist/preflight/pdfx.js +1779 -0
- package/dist/preflight/pdfx.js.map +1 -0
- package/dist/preflight/reader.d.ts +126 -0
- package/dist/preflight/reader.js +832 -0
- package/dist/preflight/reader.js.map +1 -0
- package/dist/preflight/xmp.d.ts +30 -0
- package/dist/preflight/xmp.js +145 -0
- package/dist/preflight/xmp.js.map +1 -0
- package/dist/print/index.d.ts +2 -0
- package/dist/print/index.js +3 -0
- package/dist/print/index.js.map +1 -0
- package/dist/print/output.d.ts +5 -0
- package/dist/print/output.js +199 -0
- package/dist/print/output.js.map +1 -0
- package/dist/problem.d.ts +142 -0
- package/dist/problem.js +234 -0
- package/dist/problem.js.map +1 -0
- package/dist/profile/index.d.ts +10 -0
- package/dist/profile/index.js +11 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/profile/lint.d.ts +69 -0
- package/dist/profile/lint.js +282 -0
- package/dist/profile/lint.js.map +1 -0
- package/dist/profile/metadata.d.ts +27 -0
- package/dist/profile/metadata.js +38 -0
- package/dist/profile/metadata.js.map +1 -0
- package/dist/profile/profile.d.ts +92 -0
- package/dist/profile/profile.js +282 -0
- package/dist/profile/profile.js.map +1 -0
- package/dist/project.d.ts +56 -0
- package/dist/project.js +137 -0
- package/dist/project.js.map +1 -0
- package/dist/reproducible/clock.d.ts +46 -0
- package/dist/reproducible/clock.js +173 -0
- package/dist/reproducible/clock.js.map +1 -0
- package/dist/reproducible/date.d.ts +42 -0
- package/dist/reproducible/date.js +82 -0
- package/dist/reproducible/date.js.map +1 -0
- package/dist/reproducible/index.d.ts +8 -0
- package/dist/reproducible/index.js +9 -0
- package/dist/reproducible/index.js.map +1 -0
- package/dist/spike/spike-page.chromium.json +330 -0
- package/dist/spike/spike.d.ts +75 -0
- package/dist/spike/spike.js +106 -0
- package/dist/spike/spike.js.map +1 -0
- package/dist/style/borders.d.ts +25 -0
- package/dist/style/borders.js +177 -0
- package/dist/style/borders.js.map +1 -0
- package/dist/style/colours.d.ts +34 -0
- package/dist/style/colours.js +138 -0
- package/dist/style/colours.js.map +1 -0
- package/dist/style/compile.d.ts +79 -0
- package/dist/style/compile.js +325 -0
- package/dist/style/compile.js.map +1 -0
- package/dist/style/defaults.d.ts +20 -0
- package/dist/style/defaults.js +45 -0
- package/dist/style/defaults.js.map +1 -0
- package/dist/style/gcpm.d.ts +22 -0
- package/dist/style/gcpm.js +86 -0
- package/dist/style/gcpm.js.map +1 -0
- package/dist/style/index.d.ts +4 -0
- package/dist/style/index.js +5 -0
- package/dist/style/index.js.map +1 -0
- package/dist/style/media.d.ts +22 -0
- package/dist/style/media.js +342 -0
- package/dist/style/media.js.map +1 -0
- package/dist/style/properties.d.ts +44 -0
- package/dist/style/properties.js +497 -0
- package/dist/style/properties.js.map +1 -0
- package/dist/style/scope.d.ts +6 -0
- package/dist/style/scope.js +134 -0
- package/dist/style/scope.js.map +1 -0
- package/dist/style/values.d.ts +45 -0
- package/dist/style/values.js +106 -0
- package/dist/style/values.js.map +1 -0
- package/dist/test/book.d.ts +180 -0
- package/dist/test/book.js +314 -0
- package/dist/test/book.js.map +1 -0
- package/dist/test/build.d.ts +58 -0
- package/dist/test/build.js +222 -0
- package/dist/test/build.js.map +1 -0
- package/dist/test/environment.d.ts +63 -0
- package/dist/test/environment.js +46 -0
- package/dist/test/environment.js.map +1 -0
- package/dist/test/index.d.ts +17 -0
- package/dist/test/index.js +18 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/indexes.d.ts +4 -0
- package/dist/test/indexes.js +48 -0
- package/dist/test/indexes.js.map +1 -0
- package/dist/test/layout.d.ts +8 -0
- package/dist/test/layout.js +120 -0
- package/dist/test/layout.js.map +1 -0
- package/dist/test/matchers.d.ts +80 -0
- package/dist/test/matchers.js +177 -0
- package/dist/test/matchers.js.map +1 -0
- package/dist/test/pipeline.d.ts +228 -0
- package/dist/test/pipeline.js +73 -0
- package/dist/test/pipeline.js.map +1 -0
- package/dist/test/plugins.d.ts +13 -0
- package/dist/test/plugins.js +22 -0
- package/dist/test/plugins.js.map +1 -0
- package/dist/test/render.d.ts +46 -0
- package/dist/test/render.js +149 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/runner.d.ts +61 -0
- package/dist/test/runner.js +256 -0
- package/dist/test/runner.js.map +1 -0
- package/dist/test/select.d.ts +54 -0
- package/dist/test/select.js +193 -0
- package/dist/test/select.js.map +1 -0
- package/dist/test/snapshot.d.ts +52 -0
- package/dist/test/snapshot.js +175 -0
- package/dist/test/snapshot.js.map +1 -0
- package/dist/test/text.d.ts +7 -0
- package/dist/test/text.js +46 -0
- package/dist/test/text.js.map +1 -0
- package/dist/test/vitest.d.ts +3 -0
- package/dist/test/vitest.js +39 -0
- package/dist/test/vitest.js.map +1 -0
- package/dist/text/index.d.ts +5 -0
- package/dist/text/index.js +6 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/output.d.ts +5 -0
- package/dist/text/output.js +39 -0
- package/dist/text/output.js.map +1 -0
- package/dist/text/render.d.ts +82 -0
- package/dist/text/render.js +583 -0
- package/dist/text/render.js.map +1 -0
- package/dist/text/width.d.ts +16 -0
- package/dist/text/width.js +90 -0
- package/dist/text/width.js.map +1 -0
- package/dist/text/wrap.d.ts +19 -0
- package/dist/text/wrap.js +151 -0
- package/dist/text/wrap.js.map +1 -0
- package/dist/transform/core.d.ts +19 -0
- package/dist/transform/core.js +22 -0
- package/dist/transform/core.js.map +1 -0
- package/dist/transform/index.d.ts +10 -0
- package/dist/transform/index.js +11 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/numbering.d.ts +47 -0
- package/dist/transform/numbering.js +142 -0
- package/dist/transform/numbering.js.map +1 -0
- package/dist/transform/references.d.ts +38 -0
- package/dist/transform/references.js +182 -0
- package/dist/transform/references.js.map +1 -0
- package/dist/transform/run.d.ts +32 -0
- package/dist/transform/run.js +210 -0
- package/dist/transform/run.js.map +1 -0
- package/dist/transform/store.d.ts +111 -0
- package/dist/transform/store.js +331 -0
- package/dist/transform/store.js.map +1 -0
- package/dist/transform/testing.d.ts +31 -0
- package/dist/transform/testing.js +76 -0
- package/dist/transform/testing.js.map +1 -0
- package/dist/transform/transform.d.ts +104 -0
- package/dist/transform/transform.js +89 -0
- package/dist/transform/transform.js.map +1 -0
- package/dist/vfs/fsa.d.ts +14 -0
- package/dist/vfs/fsa.js +123 -0
- package/dist/vfs/fsa.js.map +1 -0
- package/dist/vfs/index.d.ts +7 -0
- package/dist/vfs/index.js +8 -0
- package/dist/vfs/index.js.map +1 -0
- package/dist/vfs/memory.d.ts +15 -0
- package/dist/vfs/memory.js +101 -0
- package/dist/vfs/memory.js.map +1 -0
- package/dist/vfs/path.d.ts +30 -0
- package/dist/vfs/path.js +67 -0
- package/dist/vfs/path.js.map +1 -0
- package/dist/vfs/vfs.d.ts +66 -0
- package/dist/vfs/vfs.js +68 -0
- package/dist/vfs/vfs.js.map +1 -0
- package/dist/vfs/zip.d.ts +27 -0
- package/dist/vfs/zip.js +67 -0
- package/dist/vfs/zip.js.map +1 -0
- package/dist/web/css.d.ts +15 -0
- package/dist/web/css.js +80 -0
- package/dist/web/css.js.map +1 -0
- package/dist/web/hast.d.ts +44 -0
- package/dist/web/hast.js +175 -0
- package/dist/web/hast.js.map +1 -0
- package/dist/web/index.d.ts +11 -0
- package/dist/web/index.js +12 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/justify-main.d.ts +1 -0
- package/dist/web/justify-main.js +38 -0
- package/dist/web/justify-main.js.map +1 -0
- package/dist/web/justify.d.ts +46 -0
- package/dist/web/justify.js +147 -0
- package/dist/web/justify.js.map +1 -0
- package/dist/web/output.d.ts +28 -0
- package/dist/web/output.js +251 -0
- package/dist/web/output.js.map +1 -0
- package/dist/web/runtime/LICENSE-harfbuzzjs.txt +19 -0
- package/dist/web/runtime/NOTICE-patterns.txt +429 -0
- package/dist/web/runtime/harfbuzz.wasm +0 -0
- package/dist/web/runtime/justify.js.txt +2 -0
- package/dist/web/site.d.ts +53 -0
- package/dist/web/site.js +219 -0
- package/dist/web/site.js.map +1 -0
- package/docs/README.md +16 -0
- package/docs/reference/css-properties/index.md +94 -0
- package/docs/reference/css-properties/pw-adj-demerits.md +22 -0
- package/docs/reference/css-properties/pw-border-bottom-width.md +24 -0
- package/docs/reference/css-properties/pw-border-left-width.md +24 -0
- package/docs/reference/css-properties/pw-border-right-width.md +24 -0
- package/docs/reference/css-properties/pw-border-top-width.md +24 -0
- package/docs/reference/css-properties/pw-box.md +28 -0
- package/docs/reference/css-properties/pw-broken-penalty.md +22 -0
- package/docs/reference/css-properties/pw-club-penalty.md +24 -0
- package/docs/reference/css-properties/pw-column-rule-width.md +23 -0
- package/docs/reference/css-properties/pw-content-after.md +31 -0
- package/docs/reference/css-properties/pw-content-before.md +31 -0
- package/docs/reference/css-properties/pw-double-hyphen-demerits.md +23 -0
- package/docs/reference/css-properties/pw-emergency-stretch.md +28 -0
- package/docs/reference/css-properties/pw-ex-hyphen-penalty.md +22 -0
- package/docs/reference/css-properties/pw-final-hyphen-demerits.md +22 -0
- package/docs/reference/css-properties/pw-float-skip.md +22 -0
- package/docs/reference/css-properties/pw-float.md +33 -0
- package/docs/reference/css-properties/pw-footnote-max-height.md +22 -0
- package/docs/reference/css-properties/pw-footnote-skip.md +23 -0
- package/docs/reference/css-properties/pw-hyphen-penalty.md +24 -0
- package/docs/reference/css-properties/pw-inter-line-penalty.md +24 -0
- package/docs/reference/css-properties/pw-leader-space.md +22 -0
- package/docs/reference/css-properties/pw-leader.md +29 -0
- package/docs/reference/css-properties/pw-left-hyphen-min.md +23 -0
- package/docs/reference/css-properties/pw-line-breaking.md +29 -0
- package/docs/reference/css-properties/pw-line-penalty.md +23 -0
- package/docs/reference/css-properties/pw-list-indent.md +18 -0
- package/docs/reference/css-properties/pw-looseness.md +30 -0
- package/docs/reference/css-properties/pw-max-depth.md +22 -0
- package/docs/reference/css-properties/pw-minipage-footnotes.md +23 -0
- package/docs/reference/css-properties/pw-orphans.md +24 -0
- package/docs/reference/css-properties/pw-outline-width.md +23 -0
- package/docs/reference/css-properties/pw-overprint.md +26 -0
- package/docs/reference/css-properties/pw-padding-bottom.md +22 -0
- package/docs/reference/css-properties/pw-padding-left.md +22 -0
- package/docs/reference/css-properties/pw-padding-right.md +22 -0
- package/docs/reference/css-properties/pw-padding-top.md +22 -0
- package/docs/reference/css-properties/pw-page-prefix.md +28 -0
- package/docs/reference/css-properties/pw-page.md +32 -0
- package/docs/reference/css-properties/pw-penalty-after.md +23 -0
- package/docs/reference/css-properties/pw-penalty-before.md +30 -0
- package/docs/reference/css-properties/pw-pretolerance.md +23 -0
- package/docs/reference/css-properties/pw-right-hyphen-min.md +22 -0
- package/docs/reference/css-properties/pw-running.md +23 -0
- package/docs/reference/css-properties/pw-site-background.md +21 -0
- package/docs/reference/css-properties/pw-site-link.md +17 -0
- package/docs/reference/css-properties/pw-site-measure.md +17 -0
- package/docs/reference/css-properties/pw-site-muted.md +21 -0
- package/docs/reference/css-properties/pw-site-rule.md +17 -0
- package/docs/reference/css-properties/pw-site-text.md +22 -0
- package/docs/reference/css-properties/pw-space-after.md +23 -0
- package/docs/reference/css-properties/pw-space-before.md +29 -0
- package/docs/reference/css-properties/pw-string-set.md +32 -0
- package/docs/reference/css-properties/pw-tolerance.md +33 -0
- package/docs/reference/css-properties/pw-top-skip.md +22 -0
- package/docs/reference/css-properties/pw-widow-penalty.md +32 -0
- package/docs/reference/css-properties/pw-widows.md +24 -0
- package/docs/reference/css-properties/pw-word-space.md +22 -0
- package/docs/reference/css-properties/pw-xspace.md +22 -0
- package/docs/reference/index.md +17 -0
- package/docs/reference/lint-rules/black-text.md +31 -0
- package/docs/reference/lint-rules/blank-page.md +35 -0
- package/docs/reference/lint-rules/chapter-verso.md +34 -0
- package/docs/reference/lint-rules/citation-in-heading.md +24 -0
- package/docs/reference/lint-rules/consecutive-hyphens.md +34 -0
- package/docs/reference/lint-rules/empty-link.md +32 -0
- package/docs/reference/lint-rules/figure-distance.md +34 -0
- package/docs/reference/lint-rules/fonts.md +24 -0
- package/docs/reference/lint-rules/generated-text.md +24 -0
- package/docs/reference/lint-rules/heading-levels.md +30 -0
- package/docs/reference/lint-rules/ibid-across-page.md +30 -0
- package/docs/reference/lint-rules/image-alt.md +30 -0
- package/docs/reference/lint-rules/image-resolution.md +34 -0
- package/docs/reference/lint-rules/index.md +120 -0
- package/docs/reference/lint-rules/ink-limit.md +30 -0
- package/docs/reference/lint-rules/missing-field.md +37 -0
- package/docs/reference/lint-rules/orphan.md +34 -0
- package/docs/reference/lint-rules/overfull-line.md +28 -0
- package/docs/reference/lint-rules/profile.md +24 -0
- package/docs/reference/lint-rules/raw-html.md +30 -0
- package/docs/reference/lint-rules/signature.md +34 -0
- package/docs/reference/lint-rules/straight-quotes.md +33 -0
- package/docs/reference/lint-rules/svg-use-css.md +24 -0
- package/docs/reference/lint-rules/underfull-line.md +35 -0
- package/docs/reference/lint-rules/unknown-citation.md +30 -0
- package/docs/reference/lint-rules/unknown-label.md +31 -0
- package/docs/reference/lint-rules/unpaintable.md +24 -0
- package/docs/reference/lint-rules/unplaced-index.md +31 -0
- package/docs/reference/lint-rules/unused-entry.md +36 -0
- package/docs/reference/lint-rules/widow.md +34 -0
- package/docs/reference/plugin-api/assert-no-errors.md +18 -0
- package/docs/reference/plugin-api/asset-processor.md +28 -0
- package/docs/reference/plugin-api/attribute-problem.md +26 -0
- package/docs/reference/plugin-api/attribute-type.md +18 -0
- package/docs/reference/plugin-api/capabilities.md +18 -0
- package/docs/reference/plugin-api/capability.md +22 -0
- package/docs/reference/plugin-api/check-attributes.md +18 -0
- package/docs/reference/plugin-api/claim-kind.md +20 -0
- package/docs/reference/plugin-api/combine-penalties.md +17 -0
- package/docs/reference/plugin-api/command-context.md +30 -0
- package/docs/reference/plugin-api/command-definition.md +34 -0
- package/docs/reference/plugin-api/core-claims.md +18 -0
- package/docs/reference/plugin-api/define-plugin.md +20 -0
- package/docs/reference/plugin-api/define-rule.md +19 -0
- package/docs/reference/plugin-api/describe-error.md +14 -0
- package/docs/reference/plugin-api/describe-node.md +14 -0
- package/docs/reference/plugin-api/empty-registry.md +18 -0
- package/docs/reference/plugin-api/failed-on.md +32 -0
- package/docs/reference/plugin-api/fails-as.md +18 -0
- package/docs/reference/plugin-api/import-plugins.md +20 -0
- package/docs/reference/plugin-api/import-text.md +14 -0
- package/docs/reference/plugin-api/index.md +123 -0
- package/docs/reference/plugin-api/layout-definition.md +42 -0
- package/docs/reference/plugin-api/layout-slot.md +28 -0
- package/docs/reference/plugin-api/line-breaker.md +18 -0
- package/docs/reference/plugin-api/lint-context.md +48 -0
- package/docs/reference/plugin-api/lint-definition.md +32 -0
- package/docs/reference/plugin-api/lint-edition.md +38 -0
- package/docs/reference/plugin-api/lint-fix.md +36 -0
- package/docs/reference/plugin-api/lint-level.md +20 -0
- package/docs/reference/plugin-api/lint-preset.md +30 -0
- package/docs/reference/plugin-api/lint-rule.md +42 -0
- package/docs/reference/plugin-api/load-failure.md +32 -0
- package/docs/reference/plugin-api/load-plugins-options.md +32 -0
- package/docs/reference/plugin-api/load-plugins.md +20 -0
- package/docs/reference/plugin-api/loaded-plugin.md +32 -0
- package/docs/reference/plugin-api/node-claim.md +34 -0
- package/docs/reference/plugin-api/output-definition.md +28 -0
- package/docs/reference/plugin-api/owned.md +28 -0
- package/docs/reference/plugin-api/page-builder-hook.md +18 -0
- package/docs/reference/plugin-api/penalty-rule.md +34 -0
- package/docs/reference/plugin-api/plugin-api.md +18 -0
- package/docs/reference/plugin-api/plugin-definition.md +66 -0
- package/docs/reference/plugin-api/plugin-error.md +22 -0
- package/docs/reference/plugin-api/plugin-failure.md +30 -0
- package/docs/reference/plugin-api/plugin-importer.md +34 -0
- package/docs/reference/plugin-api/plugin-problem.md +30 -0
- package/docs/reference/plugin-api/plugin-registry.md +83 -0
- package/docs/reference/plugin-api/plugin-scope.md +15 -0
- package/docs/reference/plugin-api/plugin-stage.md +18 -0
- package/docs/reference/plugin-api/plugin-threw-problem.md +34 -0
- package/docs/reference/plugin-api/plugin-threw.md +21 -0
- package/docs/reference/plugin-api/plugin.md +69 -0
- package/docs/reference/plugin-api/project-with-plugins.md +36 -0
- package/docs/reference/plugin-api/read-context.md +30 -0
- package/docs/reference/plugin-api/read-failure.md +18 -0
- package/docs/reference/plugin-api/read-plugin-styles.md +22 -0
- package/docs/reference/plugin-api/reader.md +22 -0
- package/docs/reference/plugin-api/register-options.md +28 -0
- package/docs/reference/plugin-api/register-plugins.md +20 -0
- package/docs/reference/plugin-api/render-format.md +18 -0
- package/docs/reference/plugin-api/render-formats.md +18 -0
- package/docs/reference/plugin-api/renderer-registry.md +18 -0
- package/docs/reference/plugin-api/renderer-set.md +34 -0
- package/docs/reference/plugin-api/renderers.md +34 -0
- package/docs/reference/plugin-api/specifier-kind.md +14 -0
- package/docs/reference/plugin-api/style-source.md +18 -0
- package/docs/reference/plugin-api/text-context.md +28 -0
- package/docs/reference/plugin-api/text-edit.md +28 -0
- package/docs/reference/plugin-api/text-renderer.md +24 -0
- package/docs/reference/plugin-api/try-plugin-async.md +18 -0
- package/docs/reference/plugin-api/try-plugin.md +20 -0
- package/docs/reference/pulpweaver4-toml/editions.md +194 -0
- package/docs/reference/pulpweaver4-toml/index.md +182 -0
- package/docs/reference/pulpweaver4-toml/inks.md +50 -0
- package/docs/reference/pulpweaver4-toml/lint.md +36 -0
- package/docs/reference/test-matchers/index.md +33 -0
- package/docs/reference/test-matchers/to-be-recto.md +20 -0
- package/docs/reference/test-matchers/to-cite.md +22 -0
- package/docs/reference/test-matchers/to-fit-on-one-page.md +20 -0
- package/docs/reference/test-matchers/to-have-no-overfull-lines.md +20 -0
- package/docs/reference/test-matchers/to-match-html-snapshot.md +20 -0
- package/docs/reference/test-matchers/to-match-page-snapshot.md +20 -0
- package/docs/reference/test-matchers/to-match-text-snapshot.md +21 -0
- package/docs/reference/test-matchers/to-start-page.md +20 -0
- package/package.json +75 -4
- package/README.md +0 -3
|
@@ -0,0 +1,1201 @@
|
|
|
1
|
+
import { Warning } from "./options.js";
|
|
2
|
+
import { AttributeParser } from "./attributes.js";
|
|
3
|
+
import { pattern, find } from "./find.js";
|
|
4
|
+
import { InlineParser } from "./inline.js";
|
|
5
|
+
// Return array of list styles that match a marker.
|
|
6
|
+
// In ambiguous cases we return multiple values.
|
|
7
|
+
const getListStyles = function (marker) {
|
|
8
|
+
if (marker === "+" || marker === "-" || marker === "*" || marker === ":") {
|
|
9
|
+
return [marker];
|
|
10
|
+
}
|
|
11
|
+
else if (/^[+*-] \[[Xx ]\]/.exec(marker)) {
|
|
12
|
+
return [marker[0] + "X"]; // task list - include marker for consistency
|
|
13
|
+
}
|
|
14
|
+
else if (/^[(]?[0-9]+[).]/.exec(marker)) {
|
|
15
|
+
return [marker.replace(/[0-9]+/, "1")];
|
|
16
|
+
}
|
|
17
|
+
else if (/^[(]?[ivxlcdm][).]/.exec(marker)) {
|
|
18
|
+
return [marker.replace(/[a-z]+/, "i"), marker.replace(/[a-z]+/, "a")];
|
|
19
|
+
}
|
|
20
|
+
else if (/^[(]?[IVXLCDM][).]/.exec(marker)) {
|
|
21
|
+
return [marker.replace(/[A-Z]+/, "I"), marker.replace(/[A-Z]+/, "A")];
|
|
22
|
+
}
|
|
23
|
+
else if (/^[(]?[ivxlcdm]+[).]/.exec(marker)) {
|
|
24
|
+
return [marker.replace(/[a-z]+/, "i")];
|
|
25
|
+
}
|
|
26
|
+
else if (/^[(]?[IVXLCDM]+[).]/.exec(marker)) {
|
|
27
|
+
return [marker.replace(/[A-Z]+/, "I")];
|
|
28
|
+
}
|
|
29
|
+
else if (/^[(]?[a-z][).]/.exec(marker)) {
|
|
30
|
+
return [marker.replace(/[a-z]/, "a")];
|
|
31
|
+
}
|
|
32
|
+
else if (/^[(]?[A-Z][).]/.exec(marker)) {
|
|
33
|
+
return [marker.replace(/[A-Z]/, "A")];
|
|
34
|
+
}
|
|
35
|
+
else { // doesn't match any list style
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const isSpaceOrTab = function (cp) {
|
|
40
|
+
return (cp === 32 || cp === 9);
|
|
41
|
+
};
|
|
42
|
+
const isEolChar = function (cp) {
|
|
43
|
+
return (cp === 10 || cp === 13);
|
|
44
|
+
};
|
|
45
|
+
const isWhitespace = function (cp) {
|
|
46
|
+
return isSpaceOrTab(cp) || isEolChar(cp);
|
|
47
|
+
};
|
|
48
|
+
const reEol = /[\r\n]/g;
|
|
49
|
+
// a CR that is not the first half of a CRLF
|
|
50
|
+
const reLoneCR = /\r(?!\n)/;
|
|
51
|
+
// Each pattern a block spec's `open` tries below begins with a character
|
|
52
|
+
// class, so a line whose first non-space character is outside that class
|
|
53
|
+
// cannot open that kind of block and the pattern need not be run at all.
|
|
54
|
+
// The specs declare their class here and it becomes a table with one slot
|
|
55
|
+
// per ASCII character and a last slot for everything else. Only ASCII is
|
|
56
|
+
// spelled out, so a class must not reach beyond it -- no literal above
|
|
57
|
+
// \x7f, and none of \s, \S, \w, \W or \D, which match characters that are.
|
|
58
|
+
const startCharTable = function (cls) {
|
|
59
|
+
const re = new RegExp("^" + cls + "$");
|
|
60
|
+
const table = new Uint8Array(129);
|
|
61
|
+
for (let c = 0; c < 128; c++) {
|
|
62
|
+
if (re.test(String.fromCharCode(c))) {
|
|
63
|
+
table[c] = 1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return table;
|
|
67
|
+
};
|
|
68
|
+
const pattEndline = pattern("[ \\t]*\\r?\\n");
|
|
69
|
+
// no "^" needed: the sticky flag anchors the match at the search position
|
|
70
|
+
const pattWord = pattern("\\w+\\s");
|
|
71
|
+
const pattNonWhitespace = pattern("[^ \\t\\r\\n]+");
|
|
72
|
+
const pattBlockquotePrefix = pattern("[>][ \\t\\r\\n]");
|
|
73
|
+
const startBlockquote = startCharTable("[>]");
|
|
74
|
+
const pattBangs = pattern("#+");
|
|
75
|
+
const startBangs = startCharTable("[#]");
|
|
76
|
+
const pattCodeFence = pattern("(~~~~*|````*)([ \\t]*)([^ \\t\\r\\n`]*)[ \\t]*\\r?\\n");
|
|
77
|
+
const startCodeFence = startCharTable("[~`]");
|
|
78
|
+
const pattRowSep = pattern("(:?)--*(:?)([ \\t]*\\|[ \\t]*)");
|
|
79
|
+
const pattNextBarOrTicks = pattern("[^`|\\r\\n]*(?:[|]|`+)");
|
|
80
|
+
const pattCaptionStart = pattern("\\^[ \\t]+");
|
|
81
|
+
const startCaption = startCharTable("[\\^]");
|
|
82
|
+
const pattFootnoteStart = pattern("\\[\\^([^\\]\\r\\n]+)\\]:[ \\t\\r\\n]");
|
|
83
|
+
const pattThematicBreak = pattern("[-*][ \t]*[-*][ \\t]*[-*][-* \\t]*\\r?\\n");
|
|
84
|
+
const startThematicBreak = startCharTable("[-*]");
|
|
85
|
+
const pattDivFence = pattern("(::::*)[ \\t]*\\r?\\n");
|
|
86
|
+
const pattDivFenceStart = pattern("(::::*)[ \\t]*");
|
|
87
|
+
const startDivFence = startCharTable("[:]");
|
|
88
|
+
const pattDivFenceEnd = pattern("([\\w_-]*)[ \\t]*\\r?\\n");
|
|
89
|
+
const pattReferenceDefinition = pattern("\\[([^\\]\\r\\n]*)\\]:([ \\t]+[^ \\t\\r\\n]*|)[\\r\\n]");
|
|
90
|
+
// shared by the footnote and reference definition patterns above
|
|
91
|
+
const startBracket = startCharTable("[\\[]");
|
|
92
|
+
const pattTableRow = pattern("(\\|[^\\r\\n]*\\|)[ \\t]*\\r?\\n");
|
|
93
|
+
const startTableRow = startCharTable("[|]");
|
|
94
|
+
const pattListMarker = pattern("(:?[-*+:]|\\([0-9]+\\)|[0-9]+[.)]|[ivxlcdmIVXLCDM]+[.)]|\\([ivxlcdmIVXLCDM]+\\)|[a-zA-Z][.)]|\\([a-zA-Z]\\))[ \\t\\r\\n]");
|
|
95
|
+
const pattTaskListMarker = pattern("[*+-] \\[[Xx ]\\][ \\t\\r\\n]");
|
|
96
|
+
// The list marker pattern leads with an alternation rather than a single
|
|
97
|
+
// class, so this is the union of the first character of each branch: the
|
|
98
|
+
// bullet and definition markers, the "(" the parenthesised ones open with,
|
|
99
|
+
// and a digit or letter for the numbered, roman and alphabetical ones. The
|
|
100
|
+
// task list marker pattern leads with a subset of the bullets.
|
|
101
|
+
const startListMarker = startCharTable("[-*+:(0-9a-zA-Z]");
|
|
102
|
+
// the "{" of a block attribute
|
|
103
|
+
const startAttributes = startCharTable("[{]");
|
|
104
|
+
// The pattern that closes a fenced code block depends only on the fence that
|
|
105
|
+
// opened it, and a document generally fences every block the same way, so
|
|
106
|
+
// the patterns are kept rather than compiled afresh for each block. Sharing
|
|
107
|
+
// one is safe for the same reason sharing the patterns above is: find assigns
|
|
108
|
+
// lastIndex before every match.
|
|
109
|
+
const closePatterns = new Map();
|
|
110
|
+
const closePatternFor = function (border) {
|
|
111
|
+
let patt = closePatterns.get(border);
|
|
112
|
+
if (patt === undefined) {
|
|
113
|
+
patt = pattern("(" + border + border.substring(0, 1) +
|
|
114
|
+
"*)[ \\t]*[\\r\\n]");
|
|
115
|
+
closePatterns.set(border, patt);
|
|
116
|
+
}
|
|
117
|
+
return patt;
|
|
118
|
+
};
|
|
119
|
+
// How many events may pile up before the iterator drops the ones it has
|
|
120
|
+
// already handed over. Dropping them after every line would keep the array
|
|
121
|
+
// smallest, but V8 then shrinks and regrows its backing store constantly,
|
|
122
|
+
// which on a document of many short blocks costs more than it saves; waiting
|
|
123
|
+
// for a batch makes that negligible while still keeping the array's size
|
|
124
|
+
// proportional to this many events rather than to the whole document.
|
|
125
|
+
const drainThreshold = 1024;
|
|
126
|
+
var ContentType;
|
|
127
|
+
(function (ContentType) {
|
|
128
|
+
ContentType[ContentType["None"] = 0] = "None";
|
|
129
|
+
ContentType[ContentType["Inline"] = 1] = "Inline";
|
|
130
|
+
ContentType[ContentType["Block"] = 2] = "Block";
|
|
131
|
+
ContentType[ContentType["Text"] = 3] = "Text";
|
|
132
|
+
ContentType[ContentType["Cells"] = 4] = "Cells";
|
|
133
|
+
ContentType[ContentType["Attributes"] = 5] = "Attributes";
|
|
134
|
+
ContentType[ContentType["ListItem"] = 6] = "ListItem";
|
|
135
|
+
})(ContentType || (ContentType = {}));
|
|
136
|
+
class Container {
|
|
137
|
+
name;
|
|
138
|
+
type;
|
|
139
|
+
content;
|
|
140
|
+
continue;
|
|
141
|
+
close;
|
|
142
|
+
indent;
|
|
143
|
+
inlineParser;
|
|
144
|
+
attributeParser;
|
|
145
|
+
extra;
|
|
146
|
+
constructor(spec, extra) {
|
|
147
|
+
this.name = spec.name;
|
|
148
|
+
this.type = spec.type;
|
|
149
|
+
this.content = spec.content;
|
|
150
|
+
this.continue = spec.continue;
|
|
151
|
+
this.close = spec.close;
|
|
152
|
+
this.indent = 0;
|
|
153
|
+
this.inlineParser = null;
|
|
154
|
+
this.attributeParser = null;
|
|
155
|
+
this.extra = extra;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
class EventParser {
|
|
159
|
+
options;
|
|
160
|
+
warn;
|
|
161
|
+
subject;
|
|
162
|
+
maxoffset;
|
|
163
|
+
// whether the subject contains a CR that is not part of a CRLF, which
|
|
164
|
+
// decides how getEol looks for the end of a line
|
|
165
|
+
hasLoneCR;
|
|
166
|
+
indent;
|
|
167
|
+
startline;
|
|
168
|
+
starteol;
|
|
169
|
+
endeol;
|
|
170
|
+
matches;
|
|
171
|
+
containers;
|
|
172
|
+
pos;
|
|
173
|
+
lastMatchedContainer;
|
|
174
|
+
finishedLine;
|
|
175
|
+
returned;
|
|
176
|
+
specs;
|
|
177
|
+
paraSpec;
|
|
178
|
+
constructor(subject, options = {}) {
|
|
179
|
+
// Ensure the subject ends with a newline character
|
|
180
|
+
if (subject.charAt(subject.length - 1) !== '\n') {
|
|
181
|
+
subject = subject + "\n";
|
|
182
|
+
}
|
|
183
|
+
this.subject = subject;
|
|
184
|
+
this.maxoffset = subject.length - 1;
|
|
185
|
+
// the lookahead costs real time on a large subject, so it only runs
|
|
186
|
+
// when a plain scan has found a CR to begin with
|
|
187
|
+
this.hasLoneCR = subject.indexOf("\r") !== -1 && reLoneCR.test(subject);
|
|
188
|
+
this.options = options;
|
|
189
|
+
this.warn = options.warn || (() => { });
|
|
190
|
+
this.indent = 0;
|
|
191
|
+
this.startline = 0;
|
|
192
|
+
this.starteol = 0;
|
|
193
|
+
this.endeol = 0;
|
|
194
|
+
this.matches = [];
|
|
195
|
+
this.containers = [];
|
|
196
|
+
this.pos = 0;
|
|
197
|
+
this.lastMatchedContainer = 0;
|
|
198
|
+
this.finishedLine = false;
|
|
199
|
+
this.returned = 0;
|
|
200
|
+
this.paraSpec =
|
|
201
|
+
{
|
|
202
|
+
name: "para",
|
|
203
|
+
type: ContentType.Block,
|
|
204
|
+
content: ContentType.Inline,
|
|
205
|
+
continue: (container) => {
|
|
206
|
+
if (!isWhitespace(this.subject.charCodeAt(this.pos))) {
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
open: (spec) => {
|
|
214
|
+
this.addContainer(new Container(spec, {}));
|
|
215
|
+
this.addMatch(this.pos, this.pos, "+para");
|
|
216
|
+
return true;
|
|
217
|
+
},
|
|
218
|
+
close: () => {
|
|
219
|
+
this.getInlineMatches();
|
|
220
|
+
this.containers.pop();
|
|
221
|
+
const last = this.matches[this.matches.length - 1];
|
|
222
|
+
const ep = (last && last.endpos + 1) || this.pos;
|
|
223
|
+
this.addMatch(ep, ep, "-para");
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
this.specs = [
|
|
227
|
+
{
|
|
228
|
+
name: "block_quote",
|
|
229
|
+
type: ContentType.Block,
|
|
230
|
+
content: ContentType.Block,
|
|
231
|
+
startChars: startBlockquote,
|
|
232
|
+
continue: (container) => {
|
|
233
|
+
if (this.find(pattBlockquotePrefix) !== null) {
|
|
234
|
+
this.pos = this.pos + 1;
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
open: (spec) => {
|
|
242
|
+
if (this.find(pattBlockquotePrefix) !== null) {
|
|
243
|
+
this.addContainer(new Container(spec, {}));
|
|
244
|
+
this.addMatch(this.pos, this.pos, "+block_quote");
|
|
245
|
+
this.pos = this.pos + 1;
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
close: () => {
|
|
253
|
+
this.containers.pop();
|
|
254
|
+
this.addMatch(this.pos, this.pos, "-block_quote");
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "heading",
|
|
259
|
+
type: ContentType.Block,
|
|
260
|
+
content: ContentType.Inline,
|
|
261
|
+
startChars: startBangs,
|
|
262
|
+
continue: (container) => {
|
|
263
|
+
const m = this.find(pattBangs);
|
|
264
|
+
if (m && container.extra.level === (m.endpos - m.startpos + 1) &&
|
|
265
|
+
isWhitespace(this.subject.charCodeAt(m.endpos + 1))) {
|
|
266
|
+
this.pos = m.endpos + 1;
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
open: (spec) => {
|
|
274
|
+
const m = this.find(pattBangs);
|
|
275
|
+
if (m && isWhitespace(this.subject.charCodeAt(m.endpos + 1))) {
|
|
276
|
+
const level = m.endpos - m.startpos + 1;
|
|
277
|
+
this.addContainer(new Container(spec, { level: level }));
|
|
278
|
+
this.addMatch(m.startpos, m.endpos, "+heading");
|
|
279
|
+
this.pos = m.endpos + 1;
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
close: () => {
|
|
287
|
+
this.getInlineMatches();
|
|
288
|
+
this.containers.pop();
|
|
289
|
+
const last = this.matches[this.matches.length - 1];
|
|
290
|
+
const ep = (last && last.endpos + 1) || this.pos;
|
|
291
|
+
this.addMatch(ep, ep, "-heading");
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "caption",
|
|
296
|
+
type: ContentType.Block,
|
|
297
|
+
content: ContentType.Inline,
|
|
298
|
+
startChars: startCaption,
|
|
299
|
+
continue: (container) => {
|
|
300
|
+
return !isWhitespace(this.subject.charCodeAt(this.pos));
|
|
301
|
+
},
|
|
302
|
+
open: (spec) => {
|
|
303
|
+
const m = this.find(pattCaptionStart);
|
|
304
|
+
if (m) {
|
|
305
|
+
this.pos = m.endpos + 1;
|
|
306
|
+
this.addContainer(new Container(spec, {}));
|
|
307
|
+
this.addMatch(this.pos, this.pos, "+caption");
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
close: () => {
|
|
315
|
+
this.getInlineMatches();
|
|
316
|
+
this.containers.pop();
|
|
317
|
+
this.addMatch(this.pos - 1, this.pos - 1, "-caption");
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
// should go before reference definitions
|
|
321
|
+
{
|
|
322
|
+
name: "footnote",
|
|
323
|
+
type: ContentType.Block,
|
|
324
|
+
content: ContentType.Block,
|
|
325
|
+
startChars: startBracket,
|
|
326
|
+
continue: (container) => {
|
|
327
|
+
if (this.indent > (container.extra.indent || 0) ||
|
|
328
|
+
this.pos === this.starteol) {
|
|
329
|
+
return true;
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
open: (spec) => {
|
|
336
|
+
const m = this.find(pattFootnoteStart);
|
|
337
|
+
if (m) {
|
|
338
|
+
const sp = m.startpos;
|
|
339
|
+
const ep = m.endpos;
|
|
340
|
+
const label = m.captures[0];
|
|
341
|
+
// adding container will close others
|
|
342
|
+
this.addContainer(new Container(spec, {
|
|
343
|
+
note_label: label,
|
|
344
|
+
indent: this.indent
|
|
345
|
+
}));
|
|
346
|
+
this.addMatch(sp, sp, "+footnote");
|
|
347
|
+
this.addMatch(sp + 2, ep - 3, "note_label");
|
|
348
|
+
this.pos = ep;
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
close: () => {
|
|
356
|
+
this.containers.pop();
|
|
357
|
+
this.addMatch(this.pos, this.pos, "-footnote");
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "reference_definition",
|
|
362
|
+
type: ContentType.Block,
|
|
363
|
+
content: ContentType.None,
|
|
364
|
+
startChars: startBracket,
|
|
365
|
+
continue: (container) => {
|
|
366
|
+
if (container.extra.indent >= this.indent) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
const nws = this.find(pattNonWhitespace);
|
|
370
|
+
if (this.pos < this.starteol &&
|
|
371
|
+
nws && nws.endpos === this.starteol - 1) {
|
|
372
|
+
this.addMatch(this.pos, this.starteol - 1, "reference_value");
|
|
373
|
+
this.pos = this.starteol;
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
open: (spec) => {
|
|
381
|
+
const m = this.find(pattReferenceDefinition);
|
|
382
|
+
if (m) {
|
|
383
|
+
const label = m.captures[0];
|
|
384
|
+
const value = m.captures[1].trimStart();
|
|
385
|
+
this.addContainer(new Container(spec, { key: label, indent: this.indent }));
|
|
386
|
+
this.addMatch(m.startpos, m.startpos, "+reference_definition");
|
|
387
|
+
this.addMatch(m.startpos, m.startpos + label.length + 1, "reference_key");
|
|
388
|
+
if (value.length > 0) {
|
|
389
|
+
this.addMatch(this.starteol - value.length, this.starteol - 1, "reference_value");
|
|
390
|
+
}
|
|
391
|
+
this.pos = this.starteol - 1;
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
close: () => {
|
|
399
|
+
this.containers.pop();
|
|
400
|
+
this.addMatch(this.pos, this.pos, "-reference_definition");
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
// should go before list_item_spec
|
|
404
|
+
{
|
|
405
|
+
name: "thematic_break",
|
|
406
|
+
type: ContentType.Block,
|
|
407
|
+
content: ContentType.None,
|
|
408
|
+
startChars: startThematicBreak,
|
|
409
|
+
continue: (container) => {
|
|
410
|
+
return false;
|
|
411
|
+
},
|
|
412
|
+
open: (spec) => {
|
|
413
|
+
const m = this.find(pattThematicBreak);
|
|
414
|
+
if (m) {
|
|
415
|
+
this.addContainer(new Container(spec, {}));
|
|
416
|
+
this.addMatch(m.startpos, m.endpos, "thematic_break");
|
|
417
|
+
this.pos = m.endpos;
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
close: () => {
|
|
425
|
+
this.containers.pop();
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: "list",
|
|
430
|
+
type: ContentType.Block,
|
|
431
|
+
content: ContentType.ListItem,
|
|
432
|
+
startChars: startListMarker,
|
|
433
|
+
continue: (container) => {
|
|
434
|
+
// TODO remove code duplication btw list and list_item
|
|
435
|
+
if (this.indent > container.extra.indent ||
|
|
436
|
+
this.pos === this.starteol) {
|
|
437
|
+
return true;
|
|
438
|
+
}
|
|
439
|
+
else { // match a list item of the correct type
|
|
440
|
+
const m = this.find(pattListMarker);
|
|
441
|
+
if (m === null) {
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
let marker = this.subject.substring(m.startpos, m.endpos);
|
|
445
|
+
const mtask = this.find(pattTaskListMarker);
|
|
446
|
+
if (mtask !== null) {
|
|
447
|
+
marker = this.subject.substring(mtask.startpos, mtask.startpos + 5);
|
|
448
|
+
}
|
|
449
|
+
const styles = getListStyles(marker);
|
|
450
|
+
const newstyles = [];
|
|
451
|
+
for (const style of container.extra.styles) {
|
|
452
|
+
if (styles.includes(style)) {
|
|
453
|
+
newstyles.push(style);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (newstyles.length > 0) {
|
|
457
|
+
// narrow styles
|
|
458
|
+
container.extra.styles = newstyles;
|
|
459
|
+
return true;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return false;
|
|
463
|
+
},
|
|
464
|
+
open: (spec) => {
|
|
465
|
+
const m = this.find(pattListMarker);
|
|
466
|
+
if (m === null) {
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
const sp = m.startpos;
|
|
470
|
+
const ep = m.endpos;
|
|
471
|
+
let marker = this.subject.substring(sp, ep);
|
|
472
|
+
const mtask = this.find(pattTaskListMarker);
|
|
473
|
+
if (mtask !== null) {
|
|
474
|
+
marker = this.subject.substring(mtask.startpos, mtask.startpos + 5);
|
|
475
|
+
}
|
|
476
|
+
// some items have ambiguous style
|
|
477
|
+
const styles = getListStyles(marker);
|
|
478
|
+
if (styles.length === 0) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
const data = { styles: styles, indent: this.indent };
|
|
482
|
+
// adding container will close others
|
|
483
|
+
this.addContainer(new Container(spec, data));
|
|
484
|
+
let annot = "+list";
|
|
485
|
+
for (const style of styles) {
|
|
486
|
+
annot = annot + "|" + style;
|
|
487
|
+
}
|
|
488
|
+
this.addMatch(sp, ep - 1, annot);
|
|
489
|
+
return true;
|
|
490
|
+
},
|
|
491
|
+
close: () => {
|
|
492
|
+
this.containers.pop();
|
|
493
|
+
this.addMatch(this.pos, this.pos, "-list");
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
name: "list_item",
|
|
498
|
+
type: ContentType.ListItem,
|
|
499
|
+
content: ContentType.Block,
|
|
500
|
+
startChars: startListMarker,
|
|
501
|
+
continue: (container) => {
|
|
502
|
+
return (this.indent > container.extra.indent ||
|
|
503
|
+
this.pos === this.starteol);
|
|
504
|
+
},
|
|
505
|
+
open: (spec) => {
|
|
506
|
+
const m = this.find(pattListMarker);
|
|
507
|
+
if (m === null) {
|
|
508
|
+
return false;
|
|
509
|
+
}
|
|
510
|
+
const sp = m.startpos;
|
|
511
|
+
const ep = m.endpos;
|
|
512
|
+
let marker = this.subject.substring(sp, ep);
|
|
513
|
+
let checkbox = null;
|
|
514
|
+
const mtask = this.find(pattTaskListMarker);
|
|
515
|
+
if (mtask !== null) {
|
|
516
|
+
marker = this.subject.substring(mtask.startpos, mtask.startpos + 5);
|
|
517
|
+
checkbox = this.subject.substring(mtask.startpos + 3, mtask.startpos + 4);
|
|
518
|
+
}
|
|
519
|
+
// some items have ambiguous style
|
|
520
|
+
const styles = getListStyles(marker);
|
|
521
|
+
if (styles.length === 0) {
|
|
522
|
+
return false;
|
|
523
|
+
}
|
|
524
|
+
const data = { styles: styles, indent: this.indent };
|
|
525
|
+
// adding container will close others
|
|
526
|
+
this.addContainer(new Container(spec, data));
|
|
527
|
+
let annot = "+list_item";
|
|
528
|
+
for (const style of styles) {
|
|
529
|
+
annot = annot + "|" + style;
|
|
530
|
+
}
|
|
531
|
+
this.addMatch(sp, ep - 1, annot);
|
|
532
|
+
this.pos = ep;
|
|
533
|
+
if (checkbox) {
|
|
534
|
+
if (checkbox === " ") {
|
|
535
|
+
this.addMatch(sp + 2, sp + 4, "checkbox_unchecked");
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
this.addMatch(sp + 2, sp + 4, "checkbox_checked");
|
|
539
|
+
}
|
|
540
|
+
this.pos = sp + 5;
|
|
541
|
+
}
|
|
542
|
+
return true;
|
|
543
|
+
},
|
|
544
|
+
close: () => {
|
|
545
|
+
this.containers.pop();
|
|
546
|
+
this.addMatch(this.pos - 1, this.pos - 1, "-list_item");
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: "table",
|
|
551
|
+
type: ContentType.Block,
|
|
552
|
+
content: ContentType.Cells,
|
|
553
|
+
startChars: startTableRow,
|
|
554
|
+
continue: (container) => {
|
|
555
|
+
const m = this.find(pattTableRow);
|
|
556
|
+
if (m) {
|
|
557
|
+
const rawrow = m.captures[0];
|
|
558
|
+
return this.parseTableRow(m.startpos, m.startpos + rawrow.length - 1);
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
return false;
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
open: (spec) => {
|
|
565
|
+
const m = this.find(pattTableRow);
|
|
566
|
+
if (m) {
|
|
567
|
+
this.addContainer(new Container(spec, { columns: 0 }));
|
|
568
|
+
const rawrow = m.captures[0];
|
|
569
|
+
this.addMatch(m.startpos, m.startpos, "+table");
|
|
570
|
+
if (this.parseTableRow(m.startpos, m.startpos + rawrow.length - 1)) {
|
|
571
|
+
return true;
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
this.matches.pop(); // remove "+table" match
|
|
575
|
+
this.containers.pop();
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
return false;
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
close: () => {
|
|
584
|
+
this.containers.pop();
|
|
585
|
+
this.addMatch(this.pos, this.pos, "-table");
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: "attributes",
|
|
590
|
+
type: ContentType.Block,
|
|
591
|
+
content: ContentType.Attributes,
|
|
592
|
+
startChars: startAttributes,
|
|
593
|
+
open: (spec) => {
|
|
594
|
+
if (this.subject.codePointAt(this.pos) === 123) { // {
|
|
595
|
+
const attributeParser = new AttributeParser(this.subject);
|
|
596
|
+
const res = attributeParser.feed(this.pos, this.starteol);
|
|
597
|
+
if (res.status === "fail") {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
else if (res.status === "done" &&
|
|
601
|
+
find(this.subject, pattEndline, res.position + 1)
|
|
602
|
+
=== null) {
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
const container = this.addContainer(new Container(spec, {
|
|
607
|
+
status: res.status,
|
|
608
|
+
indent: this.indent,
|
|
609
|
+
startpos: this.pos,
|
|
610
|
+
slices: []
|
|
611
|
+
}));
|
|
612
|
+
container.attributeParser = attributeParser;
|
|
613
|
+
container.extra.slices =
|
|
614
|
+
[{ startpos: this.pos, endpos: this.starteol }];
|
|
615
|
+
this.pos = this.starteol;
|
|
616
|
+
return true;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
return false;
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
continue: (container) => {
|
|
624
|
+
if (container.extra.status === "done") {
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
627
|
+
if (container.attributeParser && this.indent > container.extra.indent) {
|
|
628
|
+
container.extra.slices.push({
|
|
629
|
+
startpos: this.pos,
|
|
630
|
+
endpos: this.starteol
|
|
631
|
+
});
|
|
632
|
+
const res = container.attributeParser.feed(this.pos, this.endeol);
|
|
633
|
+
container.extra.status = res.status;
|
|
634
|
+
if (res.status !== "fail" ||
|
|
635
|
+
!find(this.subject, pattEndline, res.position + 1)) {
|
|
636
|
+
this.pos = this.starteol;
|
|
637
|
+
return true;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
// if we get to here, we don't continue; either we
|
|
641
|
+
// reached the end of indentation or we failed in
|
|
642
|
+
// parsing attributes
|
|
643
|
+
// attribute parsing failed; convert to para and continue with that
|
|
644
|
+
this.addMatch(container.extra.startpos, container.extra.startpos, "+para");
|
|
645
|
+
const attrContainer = this.containers.pop(); // remove attribute contain
|
|
646
|
+
// add para container
|
|
647
|
+
const para = this.addContainer(new Container(this.paraSpec, {}));
|
|
648
|
+
// reparse the text we couldn't parse as a block attribute:
|
|
649
|
+
if (!para.inlineParser || !attrContainer) {
|
|
650
|
+
throw (new Error("Missing inlineParser or attrContainer"));
|
|
651
|
+
return false;
|
|
652
|
+
}
|
|
653
|
+
para.inlineParser.attributeSlices = attrContainer.extra.slices;
|
|
654
|
+
para.inlineParser.reparseAttributes();
|
|
655
|
+
// A container such as a block quote has already consumed its prefix
|
|
656
|
+
// on this line. Rewinding to the previous line's attribute end would
|
|
657
|
+
// feed that prefix to the paragraph as literal text.
|
|
658
|
+
this.pos = Math.max(this.pos, para.inlineParser.lastpos + 1);
|
|
659
|
+
// A blank line ends the rejected attribute's paragraph here.
|
|
660
|
+
// Continuing this container would absorb the blank and join the
|
|
661
|
+
// following text into the same paragraph.
|
|
662
|
+
return this.pos !== this.starteol;
|
|
663
|
+
},
|
|
664
|
+
close: () => {
|
|
665
|
+
const container = this.containers.pop();
|
|
666
|
+
if (!container)
|
|
667
|
+
return;
|
|
668
|
+
if (container.extra.status === "continue") {
|
|
669
|
+
// attribute parsing failed; convert to para
|
|
670
|
+
this.addMatch(container.extra.startpos, container.extra.startpos, "+para");
|
|
671
|
+
// add para container
|
|
672
|
+
const para = this.addContainer(new Container(this.paraSpec, {}), true);
|
|
673
|
+
if (!para || !para.inlineParser) {
|
|
674
|
+
throw (new Error("Could not add paragraph"));
|
|
675
|
+
}
|
|
676
|
+
// reparse the text we couldn't parse as a block attribute:
|
|
677
|
+
para.inlineParser.attributeSlices = container.extra.slices;
|
|
678
|
+
para.inlineParser.reparseAttributes();
|
|
679
|
+
para.close();
|
|
680
|
+
}
|
|
681
|
+
else {
|
|
682
|
+
this.addMatch(container.extra.startpos, container.extra.startpos, "+block_attributes");
|
|
683
|
+
if (container.attributeParser) { // should always be true
|
|
684
|
+
const attrMatches = container.attributeParser.matches;
|
|
685
|
+
for (const match of attrMatches) {
|
|
686
|
+
this.matches.push(match);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
this.addMatch(this.pos, this.pos, "-block_attributes");
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
name: "fenced_div",
|
|
695
|
+
type: ContentType.Block,
|
|
696
|
+
content: ContentType.Block,
|
|
697
|
+
startChars: startDivFence,
|
|
698
|
+
continue: (container) => {
|
|
699
|
+
const tip = this.tip();
|
|
700
|
+
if (tip && tip.name === "code_block") {
|
|
701
|
+
return true; // see #109
|
|
702
|
+
}
|
|
703
|
+
const m = this.find(pattDivFence);
|
|
704
|
+
if (m && container.extra.colons) {
|
|
705
|
+
const colons = m.captures[0];
|
|
706
|
+
if (colons.length >= container.extra.colons) {
|
|
707
|
+
container.extra.endFenceStartpos = m.startpos;
|
|
708
|
+
container.extra.endFenceEndpos = m.startpos + colons.length - 1;
|
|
709
|
+
this.pos = this.starteol; // before newline (CRLF-safe, see #113)
|
|
710
|
+
return false;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return true;
|
|
714
|
+
},
|
|
715
|
+
open: (spec) => {
|
|
716
|
+
const m = this.find(pattDivFenceStart);
|
|
717
|
+
if (!m) {
|
|
718
|
+
return false;
|
|
719
|
+
}
|
|
720
|
+
const colons = m.captures[0];
|
|
721
|
+
const m2 = find(this.subject, pattDivFenceEnd, m.endpos + 1);
|
|
722
|
+
if (!m2) {
|
|
723
|
+
return false;
|
|
724
|
+
}
|
|
725
|
+
const clsp = m2.startpos;
|
|
726
|
+
const lang = m2.captures[0];
|
|
727
|
+
this.addContainer(new Container(spec, { colons: colons.length }));
|
|
728
|
+
this.addMatch(m.startpos, m.endpos, "+div");
|
|
729
|
+
if (lang.length > 0) {
|
|
730
|
+
this.addMatch(clsp, clsp + lang.length - 1, "class");
|
|
731
|
+
}
|
|
732
|
+
this.pos = m2.endpos + 1;
|
|
733
|
+
this.finishedLine = true;
|
|
734
|
+
return true;
|
|
735
|
+
},
|
|
736
|
+
close: () => {
|
|
737
|
+
const container = this.containers.pop();
|
|
738
|
+
if (!container)
|
|
739
|
+
return;
|
|
740
|
+
const sp = container.extra.endFenceStartpos || this.pos;
|
|
741
|
+
const ep = container.extra.endFenceEndpos || this.pos;
|
|
742
|
+
// check to make sure the match is in order
|
|
743
|
+
this.addMatch(sp, ep, "-div");
|
|
744
|
+
if (sp === ep) {
|
|
745
|
+
this.warn(new Warning("Unclosed div", this.pos));
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
name: "code_block",
|
|
751
|
+
type: ContentType.Block,
|
|
752
|
+
content: ContentType.Text,
|
|
753
|
+
startChars: startCodeFence,
|
|
754
|
+
continue: (container) => {
|
|
755
|
+
const m = this.find(container.extra.closePattern);
|
|
756
|
+
if (m) {
|
|
757
|
+
container.extra.endFenceStartpos = m.startpos;
|
|
758
|
+
container.extra.endFenceEndpos = m.startpos + m.captures[0].length - 1;
|
|
759
|
+
this.pos = m.endpos; // before newline
|
|
760
|
+
this.finishedLine = true;
|
|
761
|
+
return false;
|
|
762
|
+
}
|
|
763
|
+
else {
|
|
764
|
+
return true;
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
open: (spec) => {
|
|
768
|
+
const m = this.find(pattCodeFence);
|
|
769
|
+
if (m) {
|
|
770
|
+
const [border, ws, lang] = m.captures;
|
|
771
|
+
const isRaw = lang.charAt(0) === "=" && true || false;
|
|
772
|
+
const closePattern = closePatternFor(border);
|
|
773
|
+
const cont = this.addContainer(new Container(spec, { closePattern: closePattern }));
|
|
774
|
+
cont.indent = this.indent;
|
|
775
|
+
this.addMatch(m.startpos, m.startpos + border.length - 1, "+code_block");
|
|
776
|
+
if (lang.length > 0) {
|
|
777
|
+
const langstart = m.startpos + border.length + ws.length;
|
|
778
|
+
if (isRaw) {
|
|
779
|
+
this.addMatch(langstart, langstart + lang.length - 1, "raw_format");
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
this.addMatch(langstart, langstart + lang.length - 1, "code_language");
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
this.pos = m.endpos; // before newline;
|
|
786
|
+
this.finishedLine = true;
|
|
787
|
+
return true;
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
return false;
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
close: () => {
|
|
794
|
+
const container = this.containers.pop();
|
|
795
|
+
if (!container)
|
|
796
|
+
return;
|
|
797
|
+
const sp = container.extra.endFenceStartpos || this.pos;
|
|
798
|
+
const ep = container.extra.endFenceEndpos || this.pos;
|
|
799
|
+
this.addMatch(sp, ep, "-code_block");
|
|
800
|
+
if (sp === ep) {
|
|
801
|
+
this.warn(new Warning("Unclosed code block", this.pos));
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
];
|
|
806
|
+
}
|
|
807
|
+
find(patt) {
|
|
808
|
+
return find(this.subject, patt, this.pos);
|
|
809
|
+
}
|
|
810
|
+
tip() {
|
|
811
|
+
if (this.containers.length >= 1) {
|
|
812
|
+
return this.containers[this.containers.length - 1];
|
|
813
|
+
}
|
|
814
|
+
else {
|
|
815
|
+
return null;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
addMatch(startpos, endpos, annot) {
|
|
819
|
+
this.matches.push({
|
|
820
|
+
startpos: Math.min(startpos, this.maxoffset),
|
|
821
|
+
endpos: Math.min(endpos, this.maxoffset),
|
|
822
|
+
annot: annot
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
getInlineMatches() {
|
|
826
|
+
const ilparser = this.tip()?.inlineParser;
|
|
827
|
+
if (ilparser) {
|
|
828
|
+
let last;
|
|
829
|
+
for (const match of ilparser.getMatches()) {
|
|
830
|
+
if (last && last.annot === "str" && match.annot === "str" &&
|
|
831
|
+
match.startpos === last.endpos + 1) {
|
|
832
|
+
// just extend last str:
|
|
833
|
+
this.matches[this.matches.length - 1].endpos = match.endpos;
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
this.matches.push(match);
|
|
837
|
+
}
|
|
838
|
+
last = match;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
closeUnmatchedContainers() {
|
|
843
|
+
const lastMatched = this.lastMatchedContainer;
|
|
844
|
+
// close unmatched containers
|
|
845
|
+
let tip = this.tip();
|
|
846
|
+
while (tip &&
|
|
847
|
+
this.containers.length - 1 > lastMatched) {
|
|
848
|
+
tip.close();
|
|
849
|
+
tip = this.tip();
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
addContainer(container, skipCloseUnmatched) {
|
|
853
|
+
if (!skipCloseUnmatched) {
|
|
854
|
+
this.closeUnmatchedContainers();
|
|
855
|
+
}
|
|
856
|
+
// close containers that can't contain this one:
|
|
857
|
+
let tip = this.tip();
|
|
858
|
+
while (tip && tip.content !== container.type) {
|
|
859
|
+
tip.close();
|
|
860
|
+
tip = this.tip();
|
|
861
|
+
}
|
|
862
|
+
if (container.content === ContentType.Inline) {
|
|
863
|
+
container.inlineParser =
|
|
864
|
+
new InlineParser(this.subject, { warn: this.warn });
|
|
865
|
+
}
|
|
866
|
+
this.containers.push(container);
|
|
867
|
+
return container;
|
|
868
|
+
}
|
|
869
|
+
// move parser position to first nonspace, adjusting indent
|
|
870
|
+
skipSpace() {
|
|
871
|
+
const subject = this.subject;
|
|
872
|
+
let newpos = this.pos;
|
|
873
|
+
while (isSpaceOrTab(subject.codePointAt(newpos)))
|
|
874
|
+
newpos++;
|
|
875
|
+
this.indent = newpos - this.startline;
|
|
876
|
+
this.pos = newpos;
|
|
877
|
+
}
|
|
878
|
+
// set this.starteol, this.endeol
|
|
879
|
+
getEol() {
|
|
880
|
+
const subject = this.subject;
|
|
881
|
+
const pos = this.pos;
|
|
882
|
+
// The constructor guarantees a trailing newline, so there is always a
|
|
883
|
+
// line ending at or after pos. A lone CR ends a line too, so finding
|
|
884
|
+
// the end of a line means finding the first of two characters -- but
|
|
885
|
+
// scanning for one is much faster, and unless the subject holds a CR
|
|
886
|
+
// outside a CRLF (checked once, in the constructor) the only CR that
|
|
887
|
+
// can end this line is the one just before its LF.
|
|
888
|
+
if (this.hasLoneCR) {
|
|
889
|
+
reEol.lastIndex = pos;
|
|
890
|
+
const i = reEol.exec(subject).index;
|
|
891
|
+
this.starteol = i;
|
|
892
|
+
if (subject.charCodeAt(i) === 13 && subject.charCodeAt(i + 1) === 10) {
|
|
893
|
+
this.endeol = i + 1;
|
|
894
|
+
}
|
|
895
|
+
else {
|
|
896
|
+
this.endeol = i;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
else {
|
|
900
|
+
const i = subject.indexOf("\n", pos);
|
|
901
|
+
this.starteol = (i > pos && subject.charCodeAt(i - 1) === 13) ? i - 1 : i;
|
|
902
|
+
this.endeol = i;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
parseTableCell() {
|
|
906
|
+
const inlineParser = new InlineParser(this.subject, { warn: this.warn });
|
|
907
|
+
let cellComplete = false;
|
|
908
|
+
const sp = this.pos - 1; // we start on char after |
|
|
909
|
+
let ep = sp; // for now
|
|
910
|
+
this.skipSpace();
|
|
911
|
+
while (!cellComplete) {
|
|
912
|
+
const m = this.find(pattNextBarOrTicks);
|
|
913
|
+
if (m === null) {
|
|
914
|
+
cellComplete = false;
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
else { // we matched a | or `+
|
|
918
|
+
const nextbar = m.endpos;
|
|
919
|
+
if (this.subject.charAt(nextbar) === "`" ||
|
|
920
|
+
inlineParser.inVerbatim()) {
|
|
921
|
+
inlineParser.feed(this.pos, nextbar);
|
|
922
|
+
}
|
|
923
|
+
else if (this.subject.charAt(nextbar - 1) === "\\") { // escaped |
|
|
924
|
+
inlineParser.feed(this.pos, nextbar);
|
|
925
|
+
}
|
|
926
|
+
else {
|
|
927
|
+
inlineParser.feed(this.pos, nextbar - 1);
|
|
928
|
+
ep = nextbar;
|
|
929
|
+
cellComplete = true;
|
|
930
|
+
}
|
|
931
|
+
this.pos = nextbar + 1;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
if (cellComplete) {
|
|
935
|
+
const cellMatches = inlineParser.getMatches();
|
|
936
|
+
return { startpos: sp, endpos: ep, matches: cellMatches };
|
|
937
|
+
}
|
|
938
|
+
else {
|
|
939
|
+
return null;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
// Parameters are start and end position
|
|
943
|
+
parseTableRow(sp, ep) {
|
|
944
|
+
const origMatches = this.matches.length; // so we can rewind
|
|
945
|
+
const startpos = this.pos;
|
|
946
|
+
this.addMatch(sp, sp, "+row");
|
|
947
|
+
// skip | and any initial space in the cell:
|
|
948
|
+
this.pos++;
|
|
949
|
+
// check to see if we have a separator line
|
|
950
|
+
const seps = [];
|
|
951
|
+
let p = this.pos;
|
|
952
|
+
let sepfound = false;
|
|
953
|
+
while (!sepfound) {
|
|
954
|
+
const m = find(this.subject, pattRowSep, p);
|
|
955
|
+
if (m !== null) {
|
|
956
|
+
const [left, right, trailing] = m.captures;
|
|
957
|
+
let st = "separator_default";
|
|
958
|
+
if (left.length > 0 && right.length > 0) {
|
|
959
|
+
st = "separator_center";
|
|
960
|
+
}
|
|
961
|
+
else if (right.length > 0) {
|
|
962
|
+
st = "separator_right";
|
|
963
|
+
}
|
|
964
|
+
else if (left.length > 0) {
|
|
965
|
+
st = "separator_left";
|
|
966
|
+
}
|
|
967
|
+
seps.push({
|
|
968
|
+
startpos: m.startpos, endpos: m.endpos - trailing.length,
|
|
969
|
+
annot: st
|
|
970
|
+
});
|
|
971
|
+
p = m.endpos + 1;
|
|
972
|
+
if (p === this.starteol) {
|
|
973
|
+
sepfound = true;
|
|
974
|
+
break;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
else {
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
if (sepfound) {
|
|
982
|
+
for (const match of seps) {
|
|
983
|
+
this.addMatch(match.startpos, match.endpos, match.annot);
|
|
984
|
+
}
|
|
985
|
+
this.addMatch(this.starteol - 1, this.starteol - 1, "-row");
|
|
986
|
+
this.pos = this.starteol;
|
|
987
|
+
this.finishedLine = true;
|
|
988
|
+
return true;
|
|
989
|
+
}
|
|
990
|
+
// if we get here, we're parsing a regular row
|
|
991
|
+
while (this.pos <= ep) {
|
|
992
|
+
const cell = this.parseTableCell();
|
|
993
|
+
if (cell !== null) {
|
|
994
|
+
// add matches for cell
|
|
995
|
+
this.addMatch(cell.startpos, cell.startpos, "+cell");
|
|
996
|
+
const cellMatches = cell.matches;
|
|
997
|
+
cellMatches.forEach((match, i) => {
|
|
998
|
+
const s = match.startpos;
|
|
999
|
+
let e = match.endpos;
|
|
1000
|
+
if (i === cellMatches.length - 1 && match.annot === "str") {
|
|
1001
|
+
// strip trailing spaces and tabs
|
|
1002
|
+
while (e >= s && (this.subject.codePointAt(e) === 32 ||
|
|
1003
|
+
this.subject.codePointAt(e) === 9)) {
|
|
1004
|
+
e = e - 1;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
this.addMatch(s, e, match.annot);
|
|
1008
|
+
});
|
|
1009
|
+
this.addMatch(cell.endpos, cell.endpos, "-cell");
|
|
1010
|
+
}
|
|
1011
|
+
else {
|
|
1012
|
+
// rewind, this is not a valid table row
|
|
1013
|
+
this.pos = startpos;
|
|
1014
|
+
while (this.matches.length > origMatches) {
|
|
1015
|
+
this.matches.pop();
|
|
1016
|
+
}
|
|
1017
|
+
return false;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
// if we get here, we've parsed a table row
|
|
1021
|
+
this.addMatch(this.pos, this.pos, "-row");
|
|
1022
|
+
this.pos = this.starteol;
|
|
1023
|
+
this.finishedLine = true;
|
|
1024
|
+
return true;
|
|
1025
|
+
}
|
|
1026
|
+
// Returns an iterator over events. At each iteration, the iterator
|
|
1027
|
+
// returns three values: start byte position, end byte position,
|
|
1028
|
+
// and annotation.
|
|
1029
|
+
[Symbol.iterator]() {
|
|
1030
|
+
const specs = this.specs;
|
|
1031
|
+
const subjectlen = this.subject.length;
|
|
1032
|
+
this.returned = 0;
|
|
1033
|
+
const self = this;
|
|
1034
|
+
return {
|
|
1035
|
+
next() {
|
|
1036
|
+
while (self.pos < subjectlen) {
|
|
1037
|
+
// return any accumulated matches
|
|
1038
|
+
if (self.matches.length > 0 && self.returned < self.matches.length) {
|
|
1039
|
+
self.returned = self.returned + 1;
|
|
1040
|
+
return {
|
|
1041
|
+
value: self.matches[self.returned - 1],
|
|
1042
|
+
done: false
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
// Every event collected so far has been handed over, so there is
|
|
1046
|
+
// no need to keep them. The most recent one stays: closing a
|
|
1047
|
+
// paragraph or heading ends it just after the last match before
|
|
1048
|
+
// it, which can belong to an earlier line, and keeping that match
|
|
1049
|
+
// where it was leaves every other use of this array unaffected.
|
|
1050
|
+
if (self.matches.length >= drainThreshold &&
|
|
1051
|
+
self.returned === self.matches.length) {
|
|
1052
|
+
self.matches[0] = self.matches[self.matches.length - 1];
|
|
1053
|
+
self.matches.length = 1;
|
|
1054
|
+
self.returned = 1;
|
|
1055
|
+
}
|
|
1056
|
+
self.indent = 0;
|
|
1057
|
+
self.startline = self.pos;
|
|
1058
|
+
self.finishedLine = false;
|
|
1059
|
+
self.getEol();
|
|
1060
|
+
// check open containers for continuation
|
|
1061
|
+
self.lastMatchedContainer = -1;
|
|
1062
|
+
let idx = 0;
|
|
1063
|
+
while (idx < self.containers.length) {
|
|
1064
|
+
const container = self.containers[idx];
|
|
1065
|
+
// skip any indentation
|
|
1066
|
+
self.skipSpace();
|
|
1067
|
+
if (container.continue(container)) {
|
|
1068
|
+
self.lastMatchedContainer = idx;
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
break;
|
|
1072
|
+
}
|
|
1073
|
+
idx = idx + 1;
|
|
1074
|
+
}
|
|
1075
|
+
// if we hit a close fence, we can move to next line
|
|
1076
|
+
if (self.finishedLine) {
|
|
1077
|
+
while (self.containers.length > 0 &&
|
|
1078
|
+
self.lastMatchedContainer < self.containers.length - 1) {
|
|
1079
|
+
const tip = self.tip();
|
|
1080
|
+
if (tip) {
|
|
1081
|
+
tip.close();
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
if (!self.finishedLine) {
|
|
1086
|
+
// check for new containers
|
|
1087
|
+
self.skipSpace();
|
|
1088
|
+
let isBlank = (self.pos === self.starteol);
|
|
1089
|
+
let newStarts = false;
|
|
1090
|
+
let lastMatch = self.containers[self.lastMatchedContainer];
|
|
1091
|
+
let checkStarts = !isBlank &&
|
|
1092
|
+
(!lastMatch ||
|
|
1093
|
+
lastMatch.content === ContentType.Block ||
|
|
1094
|
+
lastMatch.content === ContentType.ListItem) &&
|
|
1095
|
+
!self.find(pattWord); // optimization
|
|
1096
|
+
while (checkStarts) {
|
|
1097
|
+
checkStarts = false;
|
|
1098
|
+
// Most lines open no container, so rather than run every
|
|
1099
|
+
// spec's pattern only to have it fail, let the character the
|
|
1100
|
+
// line begins with say which specs are worth trying at all.
|
|
1101
|
+
// skipSpace above has moved past the indent, and a spec that
|
|
1102
|
+
// opens moves on again, so this is read afresh on every pass.
|
|
1103
|
+
// Anything outside ASCII goes in the table's last slot, as
|
|
1104
|
+
// does the NaN charCodeAt gives past the end of the subject.
|
|
1105
|
+
const code = self.subject.charCodeAt(self.pos);
|
|
1106
|
+
const slot = code < 128 ? code : 128;
|
|
1107
|
+
for (const spec of specs) {
|
|
1108
|
+
if (spec.startChars[slot] !== 0 &&
|
|
1109
|
+
((!lastMatch && spec.type === ContentType.Block) ||
|
|
1110
|
+
(lastMatch && lastMatch.content === spec.type))) {
|
|
1111
|
+
if (spec.open(spec)) {
|
|
1112
|
+
const tip = self.tip();
|
|
1113
|
+
if (tip) {
|
|
1114
|
+
self.lastMatchedContainer = self.containers.length - 1;
|
|
1115
|
+
lastMatch = self.containers[self.lastMatchedContainer];
|
|
1116
|
+
if (self.finishedLine) {
|
|
1117
|
+
checkStarts = false;
|
|
1118
|
+
}
|
|
1119
|
+
else {
|
|
1120
|
+
self.skipSpace();
|
|
1121
|
+
newStarts = true;
|
|
1122
|
+
checkStarts = spec.content === ContentType.Block ||
|
|
1123
|
+
spec.content === ContentType.ListItem;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
else {
|
|
1127
|
+
throw (new Error("No tip after opening container"));
|
|
1128
|
+
}
|
|
1129
|
+
break;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if (!self.finishedLine) {
|
|
1135
|
+
// handle remaining content
|
|
1136
|
+
self.skipSpace();
|
|
1137
|
+
isBlank = (self.pos === self.starteol);
|
|
1138
|
+
let tip = self.tip();
|
|
1139
|
+
const isLazy = !isBlank &&
|
|
1140
|
+
!newStarts &&
|
|
1141
|
+
self.lastMatchedContainer < self.containers.length - 1 &&
|
|
1142
|
+
tip &&
|
|
1143
|
+
tip.content === ContentType.Inline;
|
|
1144
|
+
if (!isLazy) {
|
|
1145
|
+
self.closeUnmatchedContainers();
|
|
1146
|
+
}
|
|
1147
|
+
tip = self.tip();
|
|
1148
|
+
// add para by default if there's text
|
|
1149
|
+
if (!tip || tip.content === ContentType.Block) {
|
|
1150
|
+
if (isBlank) {
|
|
1151
|
+
if (!newStarts) {
|
|
1152
|
+
// need to track these for tight/loose lists
|
|
1153
|
+
self.addMatch(self.pos, self.endeol, "blankline");
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
else {
|
|
1157
|
+
self.paraSpec.open(self.paraSpec);
|
|
1158
|
+
tip = self.tip();
|
|
1159
|
+
if (tip) {
|
|
1160
|
+
tip.inlineParser = new InlineParser(self.subject, self.options);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
if (tip && tip.content === ContentType.Text) {
|
|
1165
|
+
let startpos = self.pos;
|
|
1166
|
+
if (tip.indent !== null && self.indent > tip.indent) {
|
|
1167
|
+
// get back the leading spaces we gobbled
|
|
1168
|
+
startpos = startpos - (self.indent - tip.indent);
|
|
1169
|
+
}
|
|
1170
|
+
self.addMatch(startpos, self.endeol, "str");
|
|
1171
|
+
}
|
|
1172
|
+
else if (tip && tip.content === ContentType.Inline &&
|
|
1173
|
+
!isBlank && tip.inlineParser) {
|
|
1174
|
+
tip.inlineParser.feed(self.pos, self.endeol);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
self.pos = (self.endeol || self.pos) + 1;
|
|
1179
|
+
}
|
|
1180
|
+
// close all remaining containers
|
|
1181
|
+
self.lastMatchedContainer = -1;
|
|
1182
|
+
self.closeUnmatchedContainers();
|
|
1183
|
+
// return any accumulated matches
|
|
1184
|
+
if (self.matches.length > 0 && self.returned < self.matches.length) {
|
|
1185
|
+
self.returned = self.returned + 1;
|
|
1186
|
+
return { value: self.matches[self.returned - 1], done: false };
|
|
1187
|
+
}
|
|
1188
|
+
// catch-all (should not be needed)
|
|
1189
|
+
return {
|
|
1190
|
+
value: { startpos: self.pos, endpos: self.pos, annot: "" },
|
|
1191
|
+
done: true
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
const parseEvents = function (input, options = {}) {
|
|
1198
|
+
return new EventParser(input, options);
|
|
1199
|
+
};
|
|
1200
|
+
export { parseEvents };
|
|
1201
|
+
//# sourceMappingURL=block.js.map
|