@podlite/schema 0.0.69 → 0.0.71

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.
Files changed (114) hide show
  1. package/CHANGELOG.podlite +96 -0
  2. package/esm/ast-helpers.d.ts +11 -0
  3. package/esm/ast-helpers.js +279 -27
  4. package/esm/ast-helpers.js.map +1 -1
  5. package/esm/ast-inerator.js +1 -1
  6. package/esm/block-names.d.ts +2 -2
  7. package/esm/block-names.js +7 -0
  8. package/esm/block-names.js.map +1 -1
  9. package/esm/blocks-helpers.d.ts +1 -1
  10. package/esm/blocks-helpers.js +3 -1
  11. package/esm/blocks-helpers.js.map +1 -1
  12. package/esm/exportAny.js +5 -5
  13. package/esm/exportHtml.js +95 -38
  14. package/esm/exportHtml.js.map +1 -1
  15. package/esm/exportMarkdown.js +120 -35
  16. package/esm/exportMarkdown.js.map +1 -1
  17. package/esm/grammar.js +588 -454
  18. package/esm/grammar.js.map +1 -1
  19. package/esm/guard.js +12 -2
  20. package/esm/guard.js.map +1 -1
  21. package/esm/helpers/blockName.d.ts +8 -0
  22. package/esm/helpers/blockName.js +60 -0
  23. package/esm/helpers/blockName.js.map +1 -0
  24. package/esm/helpers/configPropagation.d.ts +12 -2
  25. package/esm/helpers/configPropagation.js +51 -13
  26. package/esm/helpers/configPropagation.js.map +1 -1
  27. package/esm/helpers/corePlugins.d.ts +1 -1
  28. package/esm/helpers/corePlugins.js +7 -5
  29. package/esm/helpers/corePlugins.js.map +1 -1
  30. package/esm/helpers/handlers.js +3 -3
  31. package/esm/helpers/ids.js +1 -1
  32. package/esm/helpers/makeInterator.js +3 -2
  33. package/esm/helpers/makeInterator.js.map +1 -1
  34. package/esm/helpers/makeTransformer.js +1 -1
  35. package/esm/helpers/parseAttributes.js +1 -1
  36. package/esm/index.d.ts +13 -3
  37. package/esm/index.js +59 -47
  38. package/esm/index.js.map +1 -1
  39. package/esm/pluggableParser.d.ts +6 -2
  40. package/esm/pluggableParser.js +15 -15
  41. package/esm/pluggableParser.js.map +1 -1
  42. package/esm/plugin-clean-location.js +1 -1
  43. package/esm/plugin-data-table.js +7 -8
  44. package/esm/plugin-data-table.js.map +1 -1
  45. package/esm/plugin-defn-fill-term.js +1 -1
  46. package/esm/plugin-formatting-codes.js +70 -29
  47. package/esm/plugin-formatting-codes.js.map +1 -1
  48. package/esm/plugin-group-items.js +1 -1
  49. package/esm/plugin-set.js +15 -18
  50. package/esm/plugin-set.js.map +1 -1
  51. package/esm/plugin-tables.js +8 -3
  52. package/esm/plugin-tables.js.map +1 -1
  53. package/esm/query-helpers.js +1 -1
  54. package/esm/selectors.d.ts +25 -8
  55. package/esm/selectors.js +399 -142
  56. package/esm/selectors.js.map +1 -1
  57. package/esm/set-assign.d.ts +17 -0
  58. package/esm/set-assign.js +143 -0
  59. package/esm/set-assign.js.map +1 -0
  60. package/esm/test-display.d.ts +3 -0
  61. package/esm/test-display.js +58 -0
  62. package/esm/test-display.js.map +1 -0
  63. package/esm/toc-caption.d.ts +7 -0
  64. package/esm/toc-caption.js +23 -0
  65. package/esm/toc-caption.js.map +1 -0
  66. package/esm/types.d.ts +16 -1
  67. package/esm/version.d.ts +1 -1
  68. package/esm/version.js +1 -1
  69. package/esm/writerHtml.js +1 -1
  70. package/esm/writerMarkdown.js +1 -1
  71. package/lib/ast-helpers.d.ts +11 -0
  72. package/lib/ast-helpers.js +279 -26
  73. package/lib/block-names.d.ts +2 -2
  74. package/lib/block-names.js +7 -0
  75. package/lib/blocks-helpers.d.ts +1 -1
  76. package/lib/blocks-helpers.js +3 -1
  77. package/lib/exportHtml.js +84 -27
  78. package/lib/exportMarkdown.js +111 -26
  79. package/lib/grammar.js +588 -454
  80. package/lib/guard.js +11 -1
  81. package/lib/helpers/blockName.d.ts +8 -0
  82. package/lib/helpers/blockName.js +66 -0
  83. package/lib/helpers/configPropagation.d.ts +12 -2
  84. package/lib/helpers/configPropagation.js +54 -14
  85. package/lib/helpers/corePlugins.d.ts +1 -1
  86. package/lib/helpers/corePlugins.js +4 -2
  87. package/lib/helpers/makeInterator.js +3 -2
  88. package/lib/index.d.ts +13 -3
  89. package/lib/index.js +33 -6
  90. package/lib/pluggableParser.d.ts +6 -2
  91. package/lib/pluggableParser.js +5 -5
  92. package/lib/plugin-data-table.js +4 -5
  93. package/lib/plugin-formatting-codes.js +65 -24
  94. package/lib/plugin-set.js +15 -18
  95. package/lib/plugin-tables.js +6 -1
  96. package/lib/selectors.d.ts +25 -8
  97. package/lib/selectors.js +401 -141
  98. package/lib/set-assign.d.ts +17 -0
  99. package/lib/set-assign.js +150 -0
  100. package/lib/test-display.d.ts +3 -0
  101. package/lib/test-display.js +67 -0
  102. package/lib/toc-caption.d.ts +7 -0
  103. package/lib/toc-caption.js +27 -0
  104. package/lib/types.d.ts +16 -1
  105. package/lib/version.d.ts +1 -1
  106. package/lib/version.js +1 -1
  107. package/package.json +3 -3
  108. package/schema/AstTree.json +160 -0
  109. package/schema/PodliteDocument.json +160 -0
  110. package/esm/helpers/makeQuery.test.d.ts +0 -1
  111. package/esm/helpers/makeQuery.test.js +0 -51
  112. package/esm/helpers/makeQuery.test.js.map +0 -1
  113. package/lib/helpers/makeQuery.test.d.ts +0 -1
  114. package/lib/helpers/makeQuery.test.js +0 -51
package/CHANGELOG.podlite CHANGED
@@ -2,6 +2,102 @@
2
2
 
3
3
  =head1 Upcoming
4
4
 
5
+ =head1 0.0.71
6
+
7
+ =item code written without a marker inside an item, a definition or a C<=nested> block is verbatim unless its own C<:allow> names markup codes, as at the top of a document; it read every markup code, and the C<:allow> of the block around it. A paragraph written without a marker there reads markup codes as an explicit C<=para> in its place does; it read the C<:allow> of the block around it. The text of a cell keeps the codes its table, row and cell allow
8
+
9
+ =item C<=config para> and C<=config code> reach a paragraph and code written without a marker, in a document, a C<=pod>, an item in every form, a definition, a C<=nested>, a cell, a semantic block and a C<=markdown> block; the text of an explicit C<=para> and of a heading and the term of a definition take none. C<=set> gives its assignments to such a paragraph or code as to the next block. The selection, C<:masked>, C<:allow> and C<:nested> treat them as an explicit C<=para> and C<=code>. Only the explicit block received them
10
+
11
+ =item the C<Para> and C<Code> nodes carry an optional C<config>, present only when C<=config> or C<=set> gave them settings
12
+
13
+ =item C<blockNameOf>, C<holderInside> and C<isSetTarget> are exported: which node of a tree is a block and of what name, and where C<=set> assignments stop
14
+
15
+ =item C<walkConfigScopes> calls a visitor for each block of a tree with the C<=config> settings in effect where the block stands
16
+
17
+ =item a blank line in the body of an indented C<=begin> block with verbatim content is kept when it is indented less than the block, an empty line among them: an indented C<=begin code> or C<=begin markdown> lost such lines, and paragraphs of Markdown ran together
18
+
19
+ =item C<runSelector> takes C<readSource>: the host reads the documents an operand with a C<file:> or a C<doc:> source names
20
+
21
+ =item the body of a C<=markdown> block is read as Markdown whatever C<:allow> it is given, on the block, by a C<=set> before it, by C<=config> or by the settings of an including file; with a code named in C<:allow> the body was read for Podlite markup codes and its headings, lists and paragraphs were lost
22
+
23
+ =item C<toHtml> writes the blocks of a C<root> block with no warning; it printed the whole document to the error stream as a node left unhandled
24
+
25
+ =item a C<=config> for C<data-table> reaches the table before it is read: a C<:mime-type> it gives reads an inline body, and an C<:allow> it gives acts in the cells; the table came out empty
26
+
27
+ =item a C<:mime-type> written on a C<=data-table> with C<:src<data:...>> is the format the data is read in; it was an error. One a C<=config> gives does not replace the format of the data
28
+
29
+ =item on the first block an C<=include> brings, a C<=set> of the included file wins over a C<=set> written before the include for the same key; the one before the include won
30
+
31
+ =item a C<=config> or C<=alias> written under a folded heading stays in effect after the section the heading folds; it ended with the section
32
+
33
+ =item a C<=config> adds its options to an earlier C<=config> for the same block or markup code, and decides the ones both set; it replaced the earlier one whole. HTML and Markdown output follow the same rule
34
+
35
+ =item C«=config C<> :allow» acts from the line it is written on; it acted on the whole block it was written in
36
+
37
+ =item C<parse> and C<toAst> take C<config>, the settings in effect where the text is placed; a C<=config> of the text is nearer than they are. C<mergeConfigSettings> joins two lists of settings by that rule
38
+
39
+ =item a C<toc> node keeps the selector it was built by in C<selector>, unless the selector line holds a markup code; C<mkToc> takes it as its last argument
40
+
41
+ =item a C<=set> written before C<=include> is kept on the include, in its C<set>, for the first block its content brings; the block after the include no longer receives it. A value a block got from C<=set> is marked C<from: 'set'> in its configuration, a default from C<=config> C<from: 'config'>, and a written one carries no mark. C<applySetToFirst> gives such assignments to the first block of a list, C<mergeSet> joins two lists of them, and C<isSetTransparent> tells a node the search passes
42
+
43
+ =item C<runSelector> throws C<SelectorError> when the source of a selector does not resolve (C<resolution>) or its address is in no answering document (C<address>); it returned nothing. A mask that no document answers is still an empty source unless it carries an address. An address is found the way a link finds its target, by the text of a heading as well as by C<:id>, and the first of two blocks sharing it answers; the last one used to. C<getDocIDs> is exported
44
+
45
+ =item a pattern C<item> finds first-level items, as C<item1> does; it found items of every level
46
+
47
+ =item C<*> finds any block a name would find, a paragraph written without a marker and a code block written by indentation among them. No pattern finds the blocks the tree adds around written ones: the root of a document, the root of a Markdown section and a folded section; the selection goes through them. C<outermost> keeps the found blocks that no other found block holds, in the order given
48
+
49
+ =item html output writes the C<:id> of a table of contents on its element, so a link to that address finds it
50
+
51
+ =item a selector source written without a scheme before the bar is read as a file, as in C<=include article.podlite | head1>; it was dropped, and the selection ran over every document given
52
+
53
+ =item a predicate C<[ :attr ]> holds for a value neither empty nor false by its kind: an empty hash no longer holds, while the number 0 and a list whose first element is empty do. C<[ :!attr ]> holds only for the value C<False>
54
+
55
+ =item the operation C<in> takes a selector as its operand: the terms of the definitions it finds, or a column of a C<=data> block, as in C<[ :status(in data:statuses#value) ]>. C<runSelector> takes C<SelectorOptions>, the current document and a reader of files, and throws C<SelectorError> when the source of such an operand does not resolve, has a format it cannot read, or lacks the address
56
+
57
+ =item a selector predicate reads a value in parentheses as a declaration does, as in C<para[ :author('John Doe') ]> and C<para[ :nested(3) ]>, and the operation C<in> with literal operands, as in C<[ :status(in 'draft','issued') ]>. An operation it does not define, C<in> without an operand, and an empty C<~<>> make the selector unreadable. Brackets, bars and whitespace inside a quoted value no longer split the selector
58
+
59
+ =item a selector C<para> finds a paragraph written without a marker, and C<code> a code block written by indentation. The text of an explicit C<=para>, of a heading and of a C<=defn> term is not taken for another paragraph
60
+
61
+ =item a selector reads the configuration the parser gave a block: a C<=config> no longer reaches blocks of another file, included or including, nor blocks after the block it is written in. A tree parsed without the plugin chain carries no such configuration, and a selector over it no longer applies its C<=config> directives
62
+
63
+ =item html output shows the caption of a table of contents, with the markup written in it and a hidden word hidden, and the wrapper of the table is written with C<class> rather than C<className>. C<tocTitleText> gives the caption of a tree that carries only the C<title> string, hidden as a whole when it holds a C<G> code
64
+
65
+ =item C<=table file:...> is reported with the code C<table-source-deferred>: the tree holds the address of the source and none of its rows
66
+
67
+ =item a table whose data source was read but holds no rows is reported with the code C<table-source-empty>, apart from a source that could not be had
68
+
69
+ =item a table of contents node takes an optional C<caption>, a caption block next to C<title>, and C<mkToc> takes it as its last argument; covered content is marked inside such a caption as well
70
+
71
+ =item C<parse> takes a C<recognition> list and fills it with the lines written as a directive of a block the parser does not know, and with the directive lines it could not read. The tree does not change
72
+
73
+ =item an C<:id> written without a value is not an address: a link to C<#true> no longer finds such a block
74
+
75
+ =item C<=test>, C<=fixture>, C<=assert> and C<=resource> are parsed as blocks. The last three keep their body as written, and the body of a fixture is not read as markup even under C<:allow>.
76
+
77
+ =item html and markdown output show a test open where it stands: its caption, the fixture and each resource as source, and what each assertion must or must not find
78
+
79
+ =item a heading with hidden text gets an address that is not made of its text, the same in production and draft, and it takes no place in the numbering of repeated headings
80
+
81
+ =item markdown output writes a named anchor, in lowercase, before a heading whose address it cannot build from the text: a hidden one, or one with an explicit C<:id>. Links to other headings follow the address a markdown reader builds, numbers of numbered headings included
82
+
83
+ =item a link that names a heading exactly is no longer taken by another heading whose shaped name matches
84
+
85
+ =item html and markdown output hide the caption of a hidden table, the title of a hidden boundary, the alternative text of a hidden picture, the title and file name written on a link in hidden content, and text in hidden content written with C<< S<> >>, an unresolved C<< A<> >> or C<< E<> >>, and the name a hidden block written in capitals shows as its heading
86
+
87
+ =head1 0.0.70
88
+
89
+ =item the published build no longer carries a test file
90
+
91
+
92
+ =item the package needs Node 20.19 or newer. Its ESM build relies on the loader recognising module syntax in a .js file, which older versions do not do
93
+
94
+
95
+ =item the package can be imported from Node directly. The emitted ESM referenced its own files without an extension, which the ESM loader refuses
96
+
97
+
98
+ =item ajv moved from 7 to 8. Under the old version an ESM consumer got a namespace object where a constructor was expected, so the package could not be imported from Node at all
99
+
100
+
5
101
  =head1 0.0.68
6
102
 
7
103
  =item a link is bound to its target on the tree, before the address is shaped for a format. A target that is not there no longer produces an address that merely looks like one: the link renders without an address, which is the form html gives a link that leads nowhere. Across the knowledge base this cut links pointing at nothing from 63 to 13
@@ -12,9 +12,18 @@ export type AnchorIndex = {
12
12
  byNode: Map<object, string>;
13
13
  byName: Map<string, string>;
14
14
  shape: (value: string) => string;
15
+ reserved?: Set<string>;
16
+ pageHeadings?: object[];
17
+ named?: Set<object>;
18
+ footnotes?: Footnotes;
19
+ };
20
+ type Footnotes = {
21
+ production: Map<object, number>;
22
+ draft: Map<object, number>;
15
23
  };
16
24
  export declare const indexAnchors: (tree: unknown, style?: AnchorStyle) => AnchorIndex;
17
25
  export declare const restyleAnchors: (index: AnchorIndex | undefined, style: AnchorStyle) => AnchorIndex | undefined;
26
+ export declare const readerAnchors: (index: AnchorIndex | undefined, renderMode?: string) => AnchorIndex | undefined;
18
27
  export declare const findAnchor: (target: string, index?: AnchorIndex) => string | undefined;
19
28
  export declare const resolveFragment: (target: string, index?: AnchorIndex) => string;
20
29
  export declare const sameDocTarget: <T>(target: T, ctx: any, index?: AnchorIndex | undefined) => T | string | undefined;
@@ -29,6 +38,7 @@ export type LinkBinding = {
29
38
  key: string;
30
39
  via: 'heading' | 'explicit-id';
31
40
  ambiguous: boolean;
41
+ node: object;
32
42
  } | {
33
43
  found: false;
34
44
  why: 'no-target';
@@ -45,3 +55,4 @@ export declare const bindTarget: (target: string, index?: BindingIndex) => LinkB
45
55
  export declare const getSafeNodeId: (node: Node, ctx: any) => string | null;
46
56
  export declare const getExplicitNodeId: (node: any, ctx: any) => string | null;
47
57
  export declare const makeAttrs: (node: any, ctx?: import("./helpers/config").Context) => import("./helpers/config").Attr;
58
+ export {};
@@ -1,5 +1,7 @@
1
- import { getTextContentFromNode } from '.';
2
- import makeAttrsPod from './helpers/config';
1
+ import { decodeHTMLStrict } from 'entities';
2
+ import { getTextContentFromNode } from './index.js';
3
+ import makeAttrsPod from './helpers/config.js';
4
+ import { collectText, maskText } from './helpers/handlers.js';
3
5
  export const getNodeId = (node, ctx) => {
4
6
  const conf = makeAttrsPod(node, ctx);
5
7
  if (conf.exists('id')) {
@@ -42,6 +44,99 @@ const takeUnique = (fragment, taken, firstRepeat) => {
42
44
  taken.set(result, taken.get(result) || 0);
43
45
  return result;
44
46
  };
47
+ const decodeEntities = (content) => Array.isArray(content)
48
+ ? content
49
+ .map((element) => {
50
+ if (element?.type === 'number' && typeof element.value === 'number')
51
+ return String.fromCharCode(element.value);
52
+ if (element?.type === 'html_named' && typeof element.value === 'string')
53
+ return decodeHTMLStrict(`&${element.value};`);
54
+ return '';
55
+ })
56
+ .join('')
57
+ : '';
58
+ // The text the markdown output puts into a heading, as a reader sees it. Hidden parts
59
+ // come out masked when the output masks them, and G<> masks everything written inside
60
+ // it at once. The markdown export writes nothing for E<> and Z<>, a footnote as its
61
+ // number, and S<> with unbreakable spaces, which a reader drops from the address.
62
+ const markdownText = (node, masked, footnotes, covered = false) => {
63
+ if (typeof node === 'string')
64
+ return covered && masked ? maskText(node) : node;
65
+ if (Array.isArray(node))
66
+ return node.map(child => markdownText(child, masked, footnotes, covered)).join('');
67
+ if (!node || typeof node !== 'object')
68
+ return '';
69
+ const n = node;
70
+ const hidden = covered || n.guarded === true;
71
+ if (n.type === 'fcode') {
72
+ if (n.name === 'G' && masked)
73
+ return maskText(collectText(n.content));
74
+ if (n.name === 'E' || n.name === 'Z')
75
+ return '';
76
+ if (n.name === 'N')
77
+ return String(footnotes.get(node) ?? '');
78
+ if (n.name === 'S')
79
+ return markdownText(n.content, masked, footnotes, hidden).replace(/ /g, '\u00a0');
80
+ }
81
+ if ((n.type === 'text' || n.type === 'verbatim') && typeof n.value === 'string')
82
+ return hidden && masked ? maskText(n.value) : n.value;
83
+ return markdownText(n.content, masked, footnotes, hidden);
84
+ };
85
+ // Footnotes are numbered in the order the markdown export meets them in the text. It
86
+ // writes nothing for a comment or a data block, reaches a footnote inside another one
87
+ // only when the notes are written at the end, and in production a G<> writes its text
88
+ // masked and never reaches a footnote inside it. Only footnotes of the text are
89
+ // numbered here: a heading holds no note written at the end.
90
+ const numberFootnotes = (tree) => {
91
+ const footnotes = { production: new Map(), draft: new Map() };
92
+ const visit = (node, insideGuard) => {
93
+ if (Array.isArray(node))
94
+ return node.forEach(child => visit(child, insideGuard));
95
+ if (!node || typeof node !== 'object')
96
+ return;
97
+ const n = node;
98
+ if (n.type === 'block' && (n.name === 'comment' || n.name === 'data'))
99
+ return;
100
+ if (n.type === 'fcode' && n.name === 'N') {
101
+ if (Array.isArray(n.content) && n.content.length > 0) {
102
+ footnotes.draft.set(node, footnotes.draft.size + 1);
103
+ if (!insideGuard)
104
+ footnotes.production.set(node, footnotes.production.size + 1);
105
+ }
106
+ return;
107
+ }
108
+ visit(n.content, insideGuard || (n.type === 'fcode' && n.name === 'G'));
109
+ };
110
+ visit(tree, false);
111
+ return footnotes;
112
+ };
113
+ // A block named in capitals comes out of the markdown export under a heading of its name.
114
+ const isSemanticBlock = (node) => node.type === 'block' &&
115
+ typeof node.name === 'string' &&
116
+ node.name === node.name.toUpperCase() &&
117
+ /\p{Lu}/u.test(node.name);
118
+ const hiddenPart = (node, covered = false) => {
119
+ if (typeof node === 'string')
120
+ return covered ? node : '';
121
+ if (Array.isArray(node))
122
+ return node.map(child => hiddenPart(child, covered)).join('');
123
+ if (!node || typeof node !== 'object')
124
+ return '';
125
+ const n = node;
126
+ const hidden = covered || n.guarded === true;
127
+ if (n.type === 'fcode' && n.name === 'E')
128
+ return hidden ? decodeEntities(n.content) : '';
129
+ if ((n.type === 'text' || n.type === 'verbatim') && typeof n.value === 'string')
130
+ return hidden ? n.value : '';
131
+ return hiddenPart(n.content, hidden);
132
+ };
133
+ // A heading hides something when a covered part of it shows a character. G<> with
134
+ // nothing inside, or with a space, hides nothing and leaves the address alone.
135
+ const hidesText = (node) => /\S/.test(hiddenPart(node));
136
+ const hasExplicitId = (node) => !!node && typeof node === 'object' && makeAttrsPod(node, {}).exists('id');
137
+ // A heading whose address is not made of its text: the author named it, or its text
138
+ // is hidden. The markdown reader cannot give it that address, so the export writes one.
139
+ const hasOwnAddress = (node) => hasExplicitId(node) || hidesText(node);
45
140
  const walkNodes = (node, visit) => {
46
141
  if (Array.isArray(node)) {
47
142
  for (const child of node)
@@ -54,35 +149,174 @@ const walkNodes = (node, visit) => {
54
149
  if ('content' in node)
55
150
  walkNodes(node.content, visit);
56
151
  };
57
- const assignAnchors = (heads, style) => {
152
+ // A heading with hidden text gets a name made of nothing it hides, and it takes no
153
+ // place in the numbering of repeats: otherwise the number of an open neighbour would
154
+ // say that a hidden heading above carries the same name.
155
+ const assignAnchors = (heads, style, reserved = new Set()) => {
58
156
  const byNode = new Map();
59
157
  const byName = new Map();
60
158
  const taken = new Map();
159
+ const hidden = [];
61
160
  for (const node of heads) {
161
+ if (!hasExplicitId(node) && hidesText(node)) {
162
+ // held in document order; the name comes once the open headings have theirs
163
+ byNode.set(node, '');
164
+ hidden.push(node);
165
+ continue;
166
+ }
62
167
  const id = getNodeId(node, {});
63
168
  if (id == null)
64
169
  continue;
65
170
  const name = id.toString();
66
171
  const anchor = takeUnique(style.shape(name), taken, style.firstRepeat);
67
172
  byNode.set(node, anchor);
68
- if (!byName.has(name))
173
+ if (!hidesText(node) && !byName.has(name))
69
174
  byName.set(name, anchor);
70
175
  }
71
- return { byNode, byName, shape: style.shape };
176
+ // A markdown reader folds case, so a generated name is kept clear of every name in
177
+ // any case: the same name then serves both outputs.
178
+ const inUse = new Set([...taken.keys(), ...reserved].map(name => name.toLowerCase()));
179
+ let count = 0;
180
+ for (const node of hidden) {
181
+ let anchor = '';
182
+ do
183
+ anchor = style.shape(`masked-${++count}`);
184
+ while (inUse.has(anchor.toLowerCase()));
185
+ inUse.add(anchor.toLowerCase());
186
+ taken.set(anchor, 0);
187
+ byNode.set(node, anchor);
188
+ }
189
+ return { byNode, byName, shape: style.shape, reserved };
190
+ };
191
+ // The addresses a markdown reader builds out of the headings as the page shows them,
192
+ // their numbers included, counting repeats over every heading the way github-slugger
193
+ // does: an empty name takes a place as well.
194
+ const readerSlugs = (headings, masked, footnotes) => {
195
+ const numbers = (masked ? footnotes?.production : footnotes?.draft) || new Map();
196
+ const occurrences = new Map();
197
+ const slugs = [];
198
+ for (const node of headings) {
199
+ const n = node;
200
+ const prefix = n.numberPrefix;
201
+ const text = n.name === 'head'
202
+ ? `${prefix ? `${prefix} ` : ''}${markdownText(n.content, masked, numbers)}`.trim()
203
+ : n.guarded === true && masked
204
+ ? maskText(String(n.name))
205
+ : String(n.name);
206
+ const base = toMarkdownFragment(text);
207
+ let slug = base;
208
+ while (occurrences.has(slug)) {
209
+ const count = (occurrences.get(base) || 0) + 1;
210
+ occurrences.set(base, count);
211
+ slug = `${base}-${count}`;
212
+ }
213
+ occurrences.set(slug, 0);
214
+ slugs.push(slug);
215
+ }
216
+ return slugs;
72
217
  };
73
218
  // Anchors are handed out in one walk before rendering. A renderer asks for the
74
219
  // same heading more than once — the numbering would run away — and a link may
75
220
  // stand before the heading it points to, so both need the whole tree first.
76
221
  export const indexAnchors = (tree, style = htmlStyle) => {
77
222
  const heads = [];
223
+ const pageHeadings = [];
224
+ const reserved = new Set();
78
225
  walkNodes(tree, node => {
79
- if (node.name === 'head')
226
+ if (node.name === 'head') {
80
227
  heads.push(node);
228
+ pageHeadings.push(node);
229
+ return;
230
+ }
231
+ if (isSemanticBlock(node))
232
+ pageHeadings.push(node);
233
+ if (hasExplicitId(node)) {
234
+ const written = makeAttrsPod(node, {}).getFirstValue('id');
235
+ if (written != null)
236
+ reserved.add(style.shape(String(written)));
237
+ }
81
238
  });
82
- return assignAnchors(heads, style);
239
+ // what a markdown reader will build, so a generated name never lands on a heading
240
+ // the reader addresses the same way. Only the masked page is read: the draft one is
241
+ // made of the hidden text, and the name must not depend on it.
242
+ const footnotes = numberFootnotes(tree);
243
+ for (const slug of readerSlugs(pageHeadings, true, footnotes))
244
+ reserved.add(slug);
245
+ return { ...assignAnchors(heads, style, reserved), pageHeadings, footnotes };
83
246
  };
84
247
  // The same headings in the same order, shaped for another output.
85
- export const restyleAnchors = (index, style) => index && assignAnchors(index.byNode.keys(), style);
248
+ export const restyleAnchors = (index, style) => index && {
249
+ ...assignAnchors(index.byNode.keys(), style, index.reserved),
250
+ pageHeadings: index.pageHeadings,
251
+ footnotes: index.footnotes,
252
+ };
253
+ /*
254
+ =begin pod :kind<export>
255
+
256
+ =head2 readerAnchors
257
+
258
+ The addresses of headings in markdown output. A markdown reader builds each address
259
+ itself, out of the heading as the page shows it, so these are the addresses it will
260
+ build: the text of the heading with its number, hidden parts masked unless the mode
261
+ is C<draft>, repeats counted the way github-slugger counts them, blocks named in
262
+ capitals included, since the export writes a heading for each.
263
+
264
+ A heading the reader cannot address that way keeps the address the html output gave
265
+ it, and C<named> lists it: a hidden heading, one with an explicit C<:id>, and one
266
+ whose built address would fall on such an address. The export writes a named anchor
267
+ before each of them.
268
+
269
+ =end pod
270
+ */
271
+ export const readerAnchors = (index, renderMode) => {
272
+ if (!index)
273
+ return index;
274
+ const headings = index.pageHeadings || [...index.byNode.keys()];
275
+ const slugs = readerSlugs(headings, renderMode !== 'draft', index.footnotes);
276
+ const slugOf = new Map();
277
+ headings.forEach((node, at) => slugOf.set(node, slugs[at]));
278
+ const named = new Set([...index.byNode.keys()].filter(hasOwnAddress));
279
+ const namedAddresses = () => new Set([...named].map(node => (index.byNode.get(node) || '').toLowerCase()));
280
+ for (let changed = true; changed;) {
281
+ changed = false;
282
+ const taken = namedAddresses();
283
+ for (const node of index.byNode.keys()) {
284
+ if (named.has(node) || !taken.has((slugOf.get(node) || '').toLowerCase()))
285
+ continue;
286
+ named.add(node);
287
+ changed = true;
288
+ }
289
+ }
290
+ const byNode = new Map();
291
+ const byName = new Map();
292
+ const namesGiven = new Set();
293
+ for (const [node, ownAddress] of index.byNode) {
294
+ // lowercased: a reader such as GitHub finds a named anchor by the lowercased
295
+ // address, and one written in capitals is not reached. Two addresses apart only
296
+ // by case would then meet, so a repeat gets a number, as the reader numbers slugs.
297
+ let anchor = slugOf.get(node) || '';
298
+ if (named.has(node)) {
299
+ const base = ownAddress.toLowerCase();
300
+ anchor = base;
301
+ for (let count = 1; namesGiven.has(anchor);)
302
+ anchor = `${base}-${++count}`;
303
+ namesGiven.add(anchor);
304
+ }
305
+ byNode.set(node, anchor);
306
+ const id = getNodeId(node, {});
307
+ if (id != null && !hidesText(node) && !byName.has(id.toString()))
308
+ byName.set(id.toString(), anchor);
309
+ }
310
+ return {
311
+ byNode,
312
+ byName,
313
+ shape: toMarkdownFragment,
314
+ reserved: index.reserved,
315
+ pageHeadings: headings,
316
+ named,
317
+ footnotes: index.footnotes,
318
+ };
319
+ };
86
320
  // Exact name first, then without regard to case: a link copied from markdown
87
321
  // carries a lowercased target, and one written by hand carries the name itself.
88
322
  export const findAnchor = (target, index) => {
@@ -112,6 +346,10 @@ export const sameDocTarget = (target, ctx, index = ctx?.__anchors) => {
112
346
  const bound = bindTarget(target.slice(1), bindings);
113
347
  if (!bound.found)
114
348
  return undefined;
349
+ // level one has named the node; its address is the one this output gave it
350
+ const anchor = index?.byNode.get(bound.node);
351
+ if (anchor !== undefined)
352
+ return `#${anchor}`;
115
353
  return `#${bound.via === 'heading' ? resolveFragment(bound.key, index) : shape(bound.key)}`;
116
354
  }
117
355
  return `#${resolveFragment(target.slice(1), index)}`;
@@ -159,35 +397,45 @@ export const buildBindingIndex = (tree, style = htmlStyle) => {
159
397
  if (via === 'explicit-id' && known.via !== 'explicit-id')
160
398
  byKey.set(key, { node, via });
161
399
  };
400
+ const written = [];
401
+ const handedOut = [];
402
+ const shapedForms = [];
162
403
  walkNodes(tree, node => {
163
404
  // The raw value the author wrote, and the form the anchor takes: getExplicitNodeId
164
405
  // already turns whitespace into a hyphen, so a link written the way the id was
165
406
  // written would otherwise miss it.
166
- const written = makeAttrsPod(node, {}).exists('id') ? makeAttrsPod(node, {}).getFirstValue('id') : null;
167
- const explicit = getExplicitNodeId(node, {});
168
- for (const key of [written == null ? null : String(written), explicit]) {
169
- if (key)
170
- put(key.normalize('NFC').trim(), node, 'explicit-id');
407
+ const raw = makeAttrsPod(node, {}).exists('id') ? makeAttrsPod(node, {}).getFirstValue('id') : null;
408
+ // :id with no value reads as the flag true, which is not a name the author wrote
409
+ if (typeof raw !== 'boolean') {
410
+ const explicit = getExplicitNodeId(node, {});
411
+ for (const key of [raw == null ? null : String(raw), explicit]) {
412
+ if (key)
413
+ written.push([key.normalize('NFC').trim(), node, 'explicit-id']);
414
+ }
171
415
  }
172
416
  if (node.name !== 'head')
173
417
  return;
174
418
  const name = getTextContentFromNode(node).normalize('NFC').trim();
175
- put(name, node, 'heading');
176
- // A heading answers to its own name and to the form an output would give it: a
177
- // link copied out of a rendered page carries the shaped name, and the author who
178
- // pastes it means the same section. Both keys name one node, so this is a second
179
- // name for the target rather than resolution decided by shaping.
419
+ written.push([name, node, 'heading']);
420
+ // The anchor actually handed out, which carries the number when a name repeats: a
421
+ // link written against the second «Parameters» asks for Parameters-2, and only the
422
+ // assignment knows that.
423
+ const assigned = anchors.byNode.get(node);
424
+ if (assigned)
425
+ handedOut.push([assigned, node, 'heading']);
426
+ // A heading also answers to the form an output would give it: a link copied out of
427
+ // a rendered page carries the shaped name, and the author who pastes it means the
428
+ // same section. Both keys name one node, so this is a second name for the target
429
+ // rather than resolution decided by shaping.
180
430
  for (const shaped of [toFragment(name), toMarkdownFragment(name)]) {
181
431
  if (shaped && shaped !== name)
182
- put(shaped, node, 'heading');
432
+ shapedForms.push([shaped, node, 'heading']);
183
433
  }
184
- // And the anchor actually handed out, which carries the number when a name
185
- // repeats: a link written against the second «Parameters» asks for Parameters-2,
186
- // and only the assignment knows that.
187
- const assigned = anchors.byNode.get(node);
188
- if (assigned)
189
- put(assigned, node, 'heading');
190
434
  });
435
+ for (const layer of [written, handedOut, shapedForms]) {
436
+ for (const [key, node, via] of layer)
437
+ put(key, node, via);
438
+ }
191
439
  return { byKey, ambiguous };
192
440
  };
193
441
  // Matching is exact: level one has to keep apart everything the tree keeps apart,
@@ -203,12 +451,17 @@ export const bindTarget = (target, index) => {
203
451
  // Two targets of one name is a fact about the document, not a reason to refuse it
204
452
  // an address: the first still answers, as it always has, and the ambiguity travels
205
453
  // with the answer for whoever reports it.
206
- return { found: true, document: 'self', key, via: hit.via, ambiguous: index.ambiguous.has(key) };
454
+ return { found: true, document: 'self', key, via: hit.via, ambiguous: index.ambiguous.has(key), node: hit.node };
207
455
  };
208
456
  export const getSafeNodeId = (node, ctx) => {
209
457
  const assigned = ctx?.__anchors?.byNode?.get(node);
210
458
  if (assigned !== undefined)
211
459
  return assigned;
460
+ const isHeading = typeof node === 'object' && node.name === 'head';
461
+ // a heading brought in after the index was built, as an =include drawn on the page
462
+ // is, must not fall back to a name made of the text it hides
463
+ if (isHeading && !hasExplicitId(node) && hidesText(node))
464
+ return null;
212
465
  const id = getNodeId(node, ctx);
213
466
  if (id == null)
214
467
  return null;
@@ -216,7 +469,6 @@ export const getSafeNodeId = (node, ctx) => {
216
469
  // only a heading derives its identifier from its own text, so only there can two
217
470
  // blocks claim the same anchor. An author-written :id is the author's business,
218
471
  // and a generated one is unique already.
219
- const isHeading = typeof node === 'object' && node.name === 'head';
220
472
  if (!isHeading)
221
473
  return fragment;
222
474
  const taken = ctx && typeof ctx === 'object' ? (ctx.__fragments ||= new Map()) : new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"ast-helpers.js","sourceRoot":"","sources":["../src/ast-helpers.ts"],"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CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IACnC,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;IACnC,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AAC9D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAA"}
@@ -1,4 +1,4 @@
1
- import { makePlug, makeRule } from './helpers/makeQuery';
1
+ import { makePlug, makeRule } from './helpers/makeQuery.js';
2
2
  // skip warnings for semantic blocks
3
3
  export function isSemanticBlock(node) {
4
4
  const name = node.name || '';
@@ -1,5 +1,5 @@
1
- export declare const BLOCK_NAMES: readonly ["boundary", "cell", "code", "comment", "data", "data-table", "defn", "formula", "head", "include", "input", "item", "markdown", "nested", "output", "para", "picture", "pod", "row", "set", "table", "toc"];
2
- export declare const VERBATIM_BLOCKS: readonly ["code", "comment", "data", "data-table", "formula", "input", "markdown", "output", "picture", "table"];
1
+ export declare const BLOCK_NAMES: readonly ["assert", "boundary", "cell", "code", "comment", "data", "data-table", "defn", "fixture", "formula", "head", "include", "input", "item", "markdown", "nested", "output", "para", "picture", "pod", "resource", "row", "set", "table", "test", "toc"];
2
+ export declare const VERBATIM_BLOCKS: readonly ["assert", "code", "comment", "data", "data-table", "fixture", "formula", "input", "markdown", "output", "picture", "resource", "table"];
3
3
  export declare const isNamedBlockName: (name: string) => boolean;
4
4
  export declare const isVerbatimBlock: (name: string) => boolean;
5
5
  export declare const isKnownBlockName: (name: string) => boolean;