comark-footnotes 0.7.6 → 0.8.1

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/README.md CHANGED
@@ -29,7 +29,7 @@ The deploy waits when the roof holds more than 12 pigeons[^count], unless it's a
29
29
  Pigeons that fly off mid-count still count.
30
30
  ```
31
31
 
32
- Notes are numbered in the order they're first referenced and listed in a section at the end. It is named `footnotes`, like Comark's plugin, and takes the same options (`label`, `hr`, `backRef`) and writes the same nodes, so it replaces it. When a plugin list holds both, Comark keeps the first.
32
+ Notes are numbered in the order they're first referenced and listed in a section at the end. It takes the same options as Comark's plugin (`label`, `hr`, `backRef`) and writes the same nodes. Remove `comark/plugins/footnotes` when you add this one.
33
33
 
34
34
  Compared with Comark's plugin, a definition inside fenced code stays in the code, Markdown in a note renders, and a note can run over several lines and blocks. A reference used twice gets its own id, `fnref-label-2`.
35
35
 
package/dist/index.mjs CHANGED
@@ -18,6 +18,9 @@ function addRule(ruler, place, anchors, name, fn, options) {
18
18
  ruler.push(name, fn, options);
19
19
  }
20
20
  //#endregion
21
+ //#region ../../shared/nodes.ts
22
+ const isElement = (node) => Array.isArray(node) && node[0] !== null;
23
+ //#endregion
21
24
  //#region src/index.ts
22
25
  const DEF = "cfn-def:";
23
26
  const REF = "cfn-ref:";
@@ -124,7 +127,6 @@ const markdownIt = (md) => {
124
127
  addRule(md.inline.ruler, "before", ["comark_inline_span", "link"], "footnote_ref", reference);
125
128
  };
126
129
  const sanitizeLabel = (label) => label.replace(/[^a-zA-Z0-9_-]/g, (char) => `-${char.charCodeAt(0).toString(16)}-`);
127
- const isElement = (node) => Array.isArray(node) && node[0] !== null;
128
130
  /** The label after a marker's tag, or nothing for another element. */
129
131
  const labelAfter = (marker, [tag]) => tag.startsWith(marker) ? tag.slice(marker.length) : void 0;
130
132
  const childrenOf = ([, , ...children]) => children;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comark-footnotes",
3
- "version": "0.7.6",
3
+ "version": "0.8.1",
4
4
  "description": "Footnotes in Comark: [^1] references, [^1]: definitions over several lines and blocks, and ^[inline notes], in place of comark/plugins/footnotes.",
5
5
  "keywords": [
6
6
  "comark",