@podlite/markdown 0.0.36 → 0.0.38

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/lib/index.esm.js CHANGED
@@ -18163,39 +18163,39 @@ var require_grammar = __commonJS({
18163
18163
  s3 = peg$parse_();
18164
18164
  if (s3 !== peg$FAILED) {
18165
18165
  s4 = peg$currPos;
18166
- s5 = peg$parsestrictIdentifier();
18167
- if (s5 === peg$FAILED) {
18168
- s5 = peg$currPos;
18169
- if (peg$c169.test(input.charAt(peg$currPos))) {
18170
- s6 = input.charAt(peg$currPos);
18171
- peg$currPos++;
18166
+ s5 = peg$currPos;
18167
+ if (peg$c169.test(input.charAt(peg$currPos))) {
18168
+ s6 = input.charAt(peg$currPos);
18169
+ peg$currPos++;
18170
+ } else {
18171
+ s6 = peg$FAILED;
18172
+ if (peg$silentFails === 0) {
18173
+ peg$fail(peg$c170);
18174
+ }
18175
+ }
18176
+ if (s6 !== peg$FAILED) {
18177
+ if (input.substr(peg$currPos, 2) === peg$c171) {
18178
+ s7 = peg$c171;
18179
+ peg$currPos += 2;
18172
18180
  } else {
18173
- s6 = peg$FAILED;
18181
+ s7 = peg$FAILED;
18174
18182
  if (peg$silentFails === 0) {
18175
- peg$fail(peg$c170);
18183
+ peg$fail(peg$c172);
18176
18184
  }
18177
18185
  }
18178
- if (s6 !== peg$FAILED) {
18179
- if (input.substr(peg$currPos, 2) === peg$c171) {
18180
- s7 = peg$c171;
18181
- peg$currPos += 2;
18182
- } else {
18183
- s7 = peg$FAILED;
18184
- if (peg$silentFails === 0) {
18185
- peg$fail(peg$c172);
18186
- }
18187
- }
18188
- if (s7 !== peg$FAILED) {
18189
- s6 = [s6, s7];
18190
- s5 = s6;
18191
- } else {
18192
- peg$currPos = s5;
18193
- s5 = peg$FAILED;
18194
- }
18186
+ if (s7 !== peg$FAILED) {
18187
+ s6 = [s6, s7];
18188
+ s5 = s6;
18195
18189
  } else {
18196
18190
  peg$currPos = s5;
18197
18191
  s5 = peg$FAILED;
18198
18192
  }
18193
+ } else {
18194
+ peg$currPos = s5;
18195
+ s5 = peg$FAILED;
18196
+ }
18197
+ if (s5 === peg$FAILED) {
18198
+ s5 = peg$parsestrictIdentifier();
18199
18199
  }
18200
18200
  if (s5 !== peg$FAILED) {
18201
18201
  s4 = input.substring(s4, peg$currPos);
@@ -18606,21 +18606,17 @@ var require_grammar = __commonJS({
18606
18606
  peg$fail(peg$c45);
18607
18607
  }
18608
18608
  }
18609
- if (s4 !== peg$FAILED) {
18610
- while (s4 !== peg$FAILED) {
18611
- s3.push(s4);
18612
- if (peg$c44.test(input.charAt(peg$currPos))) {
18613
- s4 = input.charAt(peg$currPos);
18614
- peg$currPos++;
18615
- } else {
18616
- s4 = peg$FAILED;
18617
- if (peg$silentFails === 0) {
18618
- peg$fail(peg$c45);
18619
- }
18609
+ while (s4 !== peg$FAILED) {
18610
+ s3.push(s4);
18611
+ if (peg$c44.test(input.charAt(peg$currPos))) {
18612
+ s4 = input.charAt(peg$currPos);
18613
+ peg$currPos++;
18614
+ } else {
18615
+ s4 = peg$FAILED;
18616
+ if (peg$silentFails === 0) {
18617
+ peg$fail(peg$c45);
18620
18618
  }
18621
18619
  }
18622
- } else {
18623
- s3 = peg$FAILED;
18624
18620
  }
18625
18621
  if (s3 !== peg$FAILED) {
18626
18622
  s2 = [s2, s3];
@@ -19429,21 +19425,17 @@ var require_grammarfc = __commonJS({
19429
19425
  peg$fail(peg$c45);
19430
19426
  }
19431
19427
  }
19432
- if (s4 !== peg$FAILED) {
19433
- while (s4 !== peg$FAILED) {
19434
- s3.push(s4);
19435
- if (peg$c44.test(input.charAt(peg$currPos))) {
19436
- s4 = input.charAt(peg$currPos);
19437
- peg$currPos++;
19438
- } else {
19439
- s4 = peg$FAILED;
19440
- if (peg$silentFails === 0) {
19441
- peg$fail(peg$c45);
19442
- }
19428
+ while (s4 !== peg$FAILED) {
19429
+ s3.push(s4);
19430
+ if (peg$c44.test(input.charAt(peg$currPos))) {
19431
+ s4 = input.charAt(peg$currPos);
19432
+ peg$currPos++;
19433
+ } else {
19434
+ s4 = peg$FAILED;
19435
+ if (peg$silentFails === 0) {
19436
+ peg$fail(peg$c45);
19443
19437
  }
19444
19438
  }
19445
- } else {
19446
- s3 = peg$FAILED;
19447
19439
  }
19448
19440
  if (s3 !== peg$FAILED) {
19449
19441
  s2 = [s2, s3];
@@ -25754,7 +25746,7 @@ var require_package = __commonJS({
25754
25746
  "../podlite-schema/package.json"(exports, module) {
25755
25747
  module.exports = {
25756
25748
  name: "@podlite/schema",
25757
- version: "0.0.43",
25749
+ version: "0.0.45",
25758
25750
  description: "AST tools and schema for Podlite markup language \u2014 validate, traverse, and transform document trees",
25759
25751
  main: "./src/index.ts",
25760
25752
  homepage: "https://podlite.org",
@@ -26672,8 +26664,11 @@ var rules = {
26672
26664
  setFn((node, ctx) => {
26673
26665
  const { level } = node;
26674
26666
  const prefix = "#".repeat(level) + " ";
26667
+ const numberPrefix = node.numberPrefix ? `${node.numberPrefix} ` : "";
26675
26668
  return (writer, processor) => (node2, ctx2, interator) => {
26676
26669
  writer.writeRaw(prefix);
26670
+ if (numberPrefix)
26671
+ writer.writeRaw(numberPrefix);
26677
26672
  if (node2.content)
26678
26673
  interator(node2.content, ctx2);
26679
26674
  writer.writeRaw("\n");
@@ -27920,7 +27915,8 @@ var rules2 = {
27920
27915
  setFn((node, ctx) => {
27921
27916
  const { level } = node;
27922
27917
  const id = getNodeId(node, ctx);
27923
- return wrapContent(`<h${level}${id ? ` id="${id}"` : ""}>`, `</h${level}>`);
27918
+ const open = `<h${level}${id ? ` id="${id}"` : ""}>${node.numberPrefix ? `<span class="head-number">${node.numberPrefix}</span> ` : ""}`;
27919
+ return wrapContent(open, `</h${level}>`);
27924
27920
  })
27925
27921
  ),
27926
27922
  ":list": setFn(