@ng-doc/utils 21.0.6 → 21.1.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/index.esm.js CHANGED
@@ -20,9 +20,12 @@ import { stringifyEntities as stringifyEntities$1 } from 'stringify-entities';
20
20
  * @param html
21
21
  */
22
22
  function minify(html) {
23
- return unified().use(rehypeParse, {
24
- fragment: true
25
- }).use(rehypeStringify).use(rehypeMinifyWhitespace).processSync(html).toString();
23
+ return unified()
24
+ .use(rehypeParse, { fragment: true })
25
+ .use(rehypeStringify)
26
+ .use(rehypeMinifyWhitespace)
27
+ .processSync(html)
28
+ .toString();
26
29
  }
27
30
 
28
31
  /**
@@ -31,8 +34,8 @@ function minify(html) {
31
34
  * @param attr
32
35
  */
33
36
  function attrValue(node, attr) {
34
- const attrKey = attr.toLowerCase();
35
- return node.properties?.[attrKey] ? String(node.properties[attrKey]) : undefined;
37
+ const attrKey = attr.toLowerCase();
38
+ return node.properties?.[attrKey] ? String(node.properties[attrKey]) : undefined;
36
39
  }
37
40
 
38
41
  /**
@@ -41,8 +44,8 @@ function attrValue(node, attr) {
41
44
  * @param cls
42
45
  */
43
46
  function hasClass(node, cls) {
44
- const className = node.properties?.['className']?.toString() ?? '';
45
- return !!className && className.includes(cls);
47
+ const className = node.properties?.['className']?.toString() ?? '';
48
+ return !!className && className.includes(cls);
46
49
  }
47
50
 
48
51
  /**
@@ -50,7 +53,7 @@ function hasClass(node, cls) {
50
53
  * @param ancestors
51
54
  */
52
55
  function hasLinkAncestor(ancestors) {
53
- return ancestors.some(ancestor => isElement$1(ancestor, 'a'));
56
+ return ancestors.some((ancestor) => isElement$1(ancestor, 'a'));
54
57
  }
55
58
 
56
59
  /**
@@ -59,7 +62,7 @@ function hasLinkAncestor(ancestors) {
59
62
  * @param node
60
63
  */
61
64
  function isCodeBlock(parent, node) {
62
- return parent?.type === 'element' && parent.tagName === 'pre' && node.tagName === 'code';
65
+ return parent?.type === 'element' && parent.tagName === 'pre' && node.tagName === 'code';
63
66
  }
64
67
 
65
68
  /**
@@ -67,7 +70,7 @@ function isCodeBlock(parent, node) {
67
70
  * @param node
68
71
  */
69
72
  function isCodeNode(node) {
70
- return isElement$1(node, 'code') || isElement$1(node, 'ng-doc-code');
73
+ return isElement$1(node, 'code') || isElement$1(node, 'ng-doc-code');
71
74
  }
72
75
 
73
76
  /**
@@ -75,7 +78,7 @@ function isCodeNode(node) {
75
78
  * @param node
76
79
  */
77
80
  function isElement(node) {
78
- return node?.type === 'element';
81
+ return node?.type === 'element';
79
82
  }
80
83
 
81
84
  const HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
@@ -84,7 +87,7 @@ const HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
84
87
  * @param node
85
88
  */
86
89
  function isHeading(node) {
87
- return isElement$1(node, HEADINGS);
90
+ return isElement$1(node, HEADINGS);
88
91
  }
89
92
 
90
93
  const ALWAYS_ALLOWED_LANGUAGES = ['typescript', 'ts', 'angular-ts'];
@@ -96,30 +99,32 @@ const MATCH_KEYWORD_REGEXP = /(?<key>[*\p{L}\w$@-]+)((?<delimiter>[.#])(?<anchor
96
99
  * @param config
97
100
  */
98
101
  function keywordsPlugin(config) {
99
- return tree => visitParents(tree, 'element', (node, ancestors) => {
100
- if (!isCodeNode(node)) {
101
- return;
102
- }
103
- const isInlineCode = !isElement$1(ancestors[ancestors.length - 1], 'pre');
104
- const lang = asArray(node.properties?.['className'] ?? []).find(className => className.startsWith('language-'))?.replace('language-', '') ?? '';
105
- if (isInlineCode || LANGUAGES.includes(lang)) {
106
- visitParents(node, 'text', (node, ancestors) => {
107
- if (hasLinkAncestor(ancestors)) {
108
- return;
102
+ return (tree) => visitParents(tree, 'element', (node, ancestors) => {
103
+ if (!isCodeNode(node)) {
104
+ return;
109
105
  }
110
- const parent = ancestors[ancestors.length - 1];
111
- const index = parent.children.indexOf(node);
112
- // Parse the text for words that we can convert to links
113
- const nodes = getNodes(node, parent, isInlineCode, config, lang);
114
- // Replace the text node with the links and leftover text nodes
115
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
116
- // @ts-ignore
117
- Array.prototype.splice.apply(parent.children, [index, 1].concat(nodes));
118
- // Do not visit this node's children or the newly added nodes
119
- return [SKIP, index + nodes.length];
120
- });
121
- }
122
- });
106
+ const isInlineCode = !isElement$1(ancestors[ancestors.length - 1], 'pre');
107
+ const lang = asArray(node.properties?.['className'] ?? [])
108
+ .find((className) => className.startsWith('language-'))
109
+ ?.replace('language-', '') ?? '';
110
+ if (isInlineCode || LANGUAGES.includes(lang)) {
111
+ visitParents(node, 'text', (node, ancestors) => {
112
+ if (hasLinkAncestor(ancestors)) {
113
+ return;
114
+ }
115
+ const parent = ancestors[ancestors.length - 1];
116
+ const index = parent.children.indexOf(node);
117
+ // Parse the text for words that we can convert to links
118
+ const nodes = getNodes(node, parent, isInlineCode, config, lang);
119
+ // Replace the text node with the links and leftover text nodes
120
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
121
+ // @ts-ignore
122
+ Array.prototype.splice.apply(parent.children, [index, 1].concat(nodes));
123
+ // Do not visit this node's children or the newly added nodes
124
+ return [SKIP, index + nodes.length];
125
+ });
126
+ }
127
+ });
123
128
  }
124
129
  /**
125
130
  *
@@ -130,71 +135,54 @@ function keywordsPlugin(config) {
130
135
  * @param language
131
136
  */
132
137
  function getNodes(node, parent, isInlineCode, config, language) {
133
- const {
134
- addUsedKeyword,
135
- getKeyword
136
- } = config;
137
- return toString(node).split(SPLIT_REGEXP).map(word => {
138
- const match = word.match(MATCH_KEYWORD_REGEXP);
139
- if (!match) {
140
- return {
141
- type: 'text',
142
- value: word
143
- };
144
- }
145
- const {
146
- key = '',
147
- delimiter = '',
148
- anchor = '',
149
- queryParams = ''
150
- } = match.groups;
151
- const usedKeyword = `${key}${delimiter}${anchor?.toLowerCase()}`;
152
- const rootKeyword = getKeyword?.(key);
153
- const keyword = getKeyword?.(usedKeyword);
154
- const isGuideKeyword = key.startsWith('*');
155
- const isLanguageAllowed = !keyword?.languages && ALWAYS_ALLOWED_LANGUAGES.includes(language) || !!keyword?.languages?.includes(language);
156
- // If language of code block is not allowed, return the word as is
157
- if (!isInlineCode && keyword && !isLanguageAllowed) {
158
- return {
159
- type: 'text',
160
- value: word
161
- };
162
- }
163
- // If the keyword is just an asterisk, return the word as is
164
- if (isGuideKeyword && key.length === 1) {
165
- return {
166
- type: 'text',
167
- value: word
168
- };
169
- }
170
- addUsedKeyword?.(usedKeyword);
171
- const notFoundGuideKeyword = isGuideKeyword && !keyword;
172
- const notFoundApiAnchorKeyword = !!rootKeyword && !!anchor && !keyword;
173
- if (getKeyword && isInlineCode && (notFoundGuideKeyword || notFoundApiAnchorKeyword)) {
174
- throw new Error(`Route with keyword "${word}" is missing.`);
175
- }
176
- // Convert code tag to a link tag or highlight it with a class
177
- if (parent.properties) {
178
- if (isInlineCode && keyword?.type === 'link') {
179
- parent.tagName = 'a';
180
- parent.properties = {
181
- href: `${keyword.path}${queryParams ?? ''}`,
182
- className: [NG_DOC_ELEMENT]
183
- };
184
- return {
185
- type: 'text',
186
- value: keyword.title
187
- };
188
- } else if (isInlineCode && keyword) {
189
- parent.properties['className'] = [NG_DOC_ELEMENT, 'ng-doc-code-with-link'];
190
- }
191
- }
192
- // Add link inside the code if it's a link to the API entity
193
- return keyword ? createLinkNode(isInlineCode ? keyword.title : word, keyword.path, keyword.type, keyword.description) : {
194
- type: 'text',
195
- value: word
196
- };
197
- });
138
+ const { addUsedKeyword, getKeyword } = config;
139
+ return toString(node)
140
+ .split(SPLIT_REGEXP)
141
+ .map((word) => {
142
+ const match = word.match(MATCH_KEYWORD_REGEXP);
143
+ if (!match) {
144
+ return { type: 'text', value: word };
145
+ }
146
+ const { key = '', delimiter = '', anchor = '', queryParams = '', } = match.groups;
147
+ const usedKeyword = `${key}${delimiter}${anchor?.toLowerCase()}`;
148
+ const rootKeyword = getKeyword?.(key);
149
+ const keyword = getKeyword?.(usedKeyword);
150
+ const isGuideKeyword = key.startsWith('*');
151
+ const isLanguageAllowed = (!keyword?.languages && ALWAYS_ALLOWED_LANGUAGES.includes(language)) ||
152
+ !!keyword?.languages?.includes(language);
153
+ // If language of code block is not allowed, return the word as is
154
+ if (!isInlineCode && keyword && !isLanguageAllowed) {
155
+ return { type: 'text', value: word };
156
+ }
157
+ // If the keyword is just an asterisk, return the word as is
158
+ if (isGuideKeyword && key.length === 1) {
159
+ return { type: 'text', value: word };
160
+ }
161
+ addUsedKeyword?.(usedKeyword);
162
+ const notFoundGuideKeyword = isGuideKeyword && !keyword;
163
+ const notFoundApiAnchorKeyword = !!rootKeyword && !!anchor && !keyword;
164
+ if (getKeyword && isInlineCode && (notFoundGuideKeyword || notFoundApiAnchorKeyword)) {
165
+ throw new Error(`Route with keyword "${word}" is missing.`);
166
+ }
167
+ // Convert code tag to a link tag or highlight it with a class
168
+ if (parent.properties) {
169
+ if (isInlineCode && keyword?.type === 'link') {
170
+ parent.tagName = 'a';
171
+ parent.properties = {
172
+ href: `${keyword.path}${queryParams ?? ''}`,
173
+ className: [NG_DOC_ELEMENT],
174
+ };
175
+ return { type: 'text', value: keyword.title };
176
+ }
177
+ else if (isInlineCode && keyword) {
178
+ parent.properties['className'] = [NG_DOC_ELEMENT, 'ng-doc-code-with-link'];
179
+ }
180
+ }
181
+ // Add link inside the code if it's a link to the API entity
182
+ return keyword
183
+ ? createLinkNode(isInlineCode ? keyword.title : word, keyword.path, keyword.type, keyword.description)
184
+ : { type: 'text', value: word };
185
+ });
198
186
  }
199
187
  /**
200
188
  *
@@ -204,20 +192,17 @@ function getNodes(node, parent, isInlineCode, config, language) {
204
192
  * @param description
205
193
  */
206
194
  function createLinkNode(text, href, type, description) {
207
- return {
208
- type: 'element',
209
- tagName: 'a',
210
- properties: {
211
- href: href,
212
- class: ['ng-doc-code-anchor', NG_DOC_ELEMENT],
213
- 'data-link-type': type,
214
- ngDocTooltip: description
215
- },
216
- children: [{
217
- type: 'text',
218
- value: text
219
- }]
220
- };
195
+ return {
196
+ type: 'element',
197
+ tagName: 'a',
198
+ properties: {
199
+ href: href,
200
+ class: ['ng-doc-code-anchor', NG_DOC_ELEMENT],
201
+ 'data-link-type': type,
202
+ ngDocTooltip: description,
203
+ },
204
+ children: [{ type: 'text', value: text }],
205
+ };
221
206
  }
222
207
 
223
208
  /**
@@ -228,24 +213,19 @@ function createLinkNode(text, href, type, description) {
228
213
  * @param addUsedKeyword
229
214
  */
230
215
  async function postProcessHtml(html) {
231
- const usedKeywords = new Set();
232
- try {
233
- const content = await unified().use(rehypeParse, {
234
- fragment: true
235
- }).use(rehypeStringify).use(keywordsPlugin, {
236
- addUsedKeyword: usedKeywords.add.bind(usedKeywords)
237
- }).process(html).then(file => file.toString());
238
- return {
239
- content,
240
- usedKeywords: Array.from(usedKeywords)
241
- };
242
- } catch (error) {
243
- return {
244
- content: html,
245
- usedKeywords: [],
246
- error
247
- };
248
- }
216
+ const usedKeywords = new Set();
217
+ try {
218
+ const content = await unified()
219
+ .use(rehypeParse, { fragment: true })
220
+ .use(rehypeStringify)
221
+ .use(keywordsPlugin, { addUsedKeyword: usedKeywords.add.bind(usedKeywords) })
222
+ .process(html)
223
+ .then((file) => file.toString());
224
+ return { content, usedKeywords: Array.from(usedKeywords) };
225
+ }
226
+ catch (error) {
227
+ return { content: html, usedKeywords: [], error };
228
+ }
249
229
  }
250
230
 
251
231
  const NO_ANCHOR_CLASS = 'no-anchor';
@@ -255,46 +235,51 @@ const NO_ANCHOR_CLASS = 'no-anchor';
255
235
  * @param route
256
236
  */
257
237
  function addHeadingAnchors(route) {
258
- return tree => visit(tree, 'element', node => {
259
- if (route && isHeading(node) && node.properties && node.properties['id'] && !hasClass(node, NO_ANCHOR_CLASS)) {
260
- node.children.push({
261
- type: 'element',
262
- tagName: 'ng-doc-heading-anchor',
263
- properties: {
264
- className: ['ng-doc-anchor'],
265
- anchor: node.properties['id']
266
- },
267
- children: []
268
- });
269
- node.properties = {
270
- ...node.properties,
271
- href: route,
272
- headingLink: 'true'
273
- };
274
- }
275
- });
238
+ return (tree) => visit(tree, 'element', (node) => {
239
+ if (route &&
240
+ isHeading(node) &&
241
+ node.properties &&
242
+ node.properties['id'] &&
243
+ !hasClass(node, NO_ANCHOR_CLASS)) {
244
+ node.children.push({
245
+ type: 'element',
246
+ tagName: 'ng-doc-heading-anchor',
247
+ properties: {
248
+ className: ['ng-doc-anchor'],
249
+ anchor: node.properties['id'],
250
+ },
251
+ children: [],
252
+ });
253
+ node.properties = {
254
+ ...node.properties,
255
+ href: route,
256
+ headingLink: 'true',
257
+ };
258
+ }
259
+ });
276
260
  }
277
261
 
278
262
  /**
279
263
  * Highlight code lines
280
264
  */
281
265
  function highlightCodeLines() {
282
- return tree => {
283
- visit(tree, 'element', (node, _i, parent) => {
284
- if (isCodeBlock(parent, node) && parent?.type === 'element') {
285
- const highlightedLines = JSON.parse(attrValue(parent, 'highlightedLines') ?? '[]');
286
- highlightedLines.length && node.children.filter(isElement).forEach((child, i) => {
287
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
288
- // @ts-ignore
289
- if (child.properties.class === 'line' && highlightedLines.includes(i + 1)) {
290
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
291
- // @ts-ignore
292
- child.properties.class = 'line highlighted';
293
- }
266
+ return (tree) => {
267
+ visit(tree, 'element', (node, _i, parent) => {
268
+ if (isCodeBlock(parent, node) && parent?.type === 'element') {
269
+ const highlightedLines = JSON.parse(attrValue(parent, 'highlightedLines') ?? '[]');
270
+ highlightedLines.length &&
271
+ node.children.filter(isElement).forEach((child, i) => {
272
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
273
+ // @ts-ignore
274
+ if (child.properties.class === 'line' && highlightedLines.includes(i + 1)) {
275
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
276
+ // @ts-ignore
277
+ child.properties.class = 'line highlighted';
278
+ }
279
+ });
280
+ }
294
281
  });
295
- }
296
- });
297
- };
282
+ };
298
283
  }
299
284
 
300
285
  /**
@@ -303,15 +288,15 @@ function highlightCodeLines() {
303
288
  * @param headings
304
289
  */
305
290
  function markElementsPlugin() {
306
- return tree => {
307
- visit(tree, 'element', node => {
308
- if (node.properties) {
309
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
310
- // @ts-ignore
311
- node.properties['className'] = [...asArray(node.properties.className), NG_DOC_ELEMENT];
312
- }
313
- });
314
- };
291
+ return (tree) => {
292
+ visit(tree, 'element', (node) => {
293
+ if (node.properties) {
294
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
295
+ // @ts-ignore
296
+ node.properties['className'] = [...asArray(node.properties.className), NG_DOC_ELEMENT];
297
+ }
298
+ });
299
+ };
315
300
  }
316
301
 
317
302
  /**
@@ -320,22 +305,22 @@ function markElementsPlugin() {
320
305
  * @param headings
321
306
  */
322
307
  function mermaidPlugin() {
323
- return tree => {
324
- visit(tree, 'element', node => {
325
- if (node.tagName === 'pre') {
326
- const codeNode = node.children[0];
327
- if (codeNode.tagName === 'code' && codeNode.properties?.['lang'] === 'mermaid') {
328
- node.properties = {
329
- className: 'mermaid'
330
- };
331
- node.children = [{
332
- type: 'text',
333
- value: toString(codeNode)
334
- }];
335
- }
336
- }
337
- });
338
- };
308
+ return (tree) => {
309
+ visit(tree, 'element', (node) => {
310
+ if (node.tagName === 'pre') {
311
+ const codeNode = node.children[0];
312
+ if (codeNode.tagName === 'code' && codeNode.properties?.['lang'] === 'mermaid') {
313
+ node.properties = { className: ['mermaid'] };
314
+ node.children = [
315
+ {
316
+ type: 'text',
317
+ value: toString(codeNode),
318
+ },
319
+ ];
320
+ }
321
+ }
322
+ });
323
+ };
339
324
  }
340
325
 
341
326
  /**
@@ -345,69 +330,75 @@ function mermaidPlugin() {
345
330
  * @param headings
346
331
  */
347
332
  function sluggerPlugin(addAnchor, headings = ['h1', 'h2', 'h3', 'h4']) {
348
- if (!addAnchor) {
349
- return () => {};
350
- }
351
- const slugger = new GithubSlugger();
352
- return tree => {
353
- slugger.reset();
354
- visitParents(tree, 'element', (node, ancestors) => {
355
- const scope = getKeywordScope(ancestors);
356
- const isHeading = !!headingRank(node) && !hasProperty(node, 'id') && !!headings?.includes(node.tagName.toLowerCase());
357
- const attrSlug = attrValue(node, 'dataSlug');
358
- const attrSlugTitle = attrValue(node, 'dataSlugTitle');
359
- const attrSlugType = attrValue(node, 'dataSlugType');
360
- const dataToSlug = isHeading ? toString(node).trim() : attrSlug;
361
- if (dataToSlug) {
362
- if (node.properties) {
363
- const id = attrSlug && attrSlugType === 'member' ? attrSlug : slugger.slug(dataToSlug);
364
- node.properties['id'] = id;
365
- addAnchor({
366
- anchorId: id,
367
- anchor: new GithubSlugger().slug(dataToSlug),
368
- title: attrSlugTitle || dataToSlug,
369
- scope,
370
- type: isHeading && attrSlugType !== 'member' || attrSlug && attrSlugType === 'heading' ? 'heading' : 'member'
371
- });
372
- }
373
- }
374
- });
375
- };
333
+ if (!addAnchor) {
334
+ return () => { };
335
+ }
336
+ const slugger = new GithubSlugger();
337
+ return (tree) => {
338
+ slugger.reset();
339
+ visitParents(tree, 'element', (node, ancestors) => {
340
+ const scope = getKeywordScope(ancestors);
341
+ const isHeading = !!headingRank(node) &&
342
+ !hasProperty(node, 'id') &&
343
+ !!headings?.includes(node.tagName.toLowerCase());
344
+ const attrSlug = attrValue(node, 'dataSlug');
345
+ const attrSlugTitle = attrValue(node, 'dataSlugTitle');
346
+ const attrSlugType = attrValue(node, 'dataSlugType');
347
+ const dataToSlug = isHeading ? toString(node).trim() : attrSlug;
348
+ if (dataToSlug) {
349
+ if (node.properties) {
350
+ const id = attrSlug && attrSlugType === 'member' ? attrSlug : slugger.slug(dataToSlug);
351
+ node.properties['id'] = id;
352
+ addAnchor({
353
+ anchorId: id,
354
+ anchor: new GithubSlugger().slug(dataToSlug),
355
+ title: attrSlugTitle || dataToSlug,
356
+ scope,
357
+ type: (isHeading && attrSlugType !== 'member') || (attrSlug && attrSlugType === 'heading')
358
+ ? 'heading'
359
+ : 'member',
360
+ });
361
+ }
362
+ }
363
+ });
364
+ };
376
365
  }
377
366
  /**
378
367
  *
379
368
  * @param ancestors
380
369
  */
381
370
  function getKeywordScope(ancestors) {
382
- const keywordScope = ancestors.find(ancestor => isElement$1(ancestor) && ancestor.tagName === 'ng-doc-keyword-scope');
383
- const key = keywordScope?.properties?.['id'];
384
- return key ? {
385
- key: String(key),
386
- title: String(keywordScope?.properties?.['title'])
387
- } : undefined;
371
+ const keywordScope = ancestors.find((ancestor) => isElement$1(ancestor) && ancestor.tagName === 'ng-doc-keyword-scope');
372
+ const key = keywordScope?.properties?.['id'];
373
+ return key
374
+ ? {
375
+ key: String(key),
376
+ title: String(keywordScope?.properties?.['title']),
377
+ }
378
+ : undefined;
388
379
  }
389
380
 
390
381
  /**
391
382
  *
392
383
  */
393
384
  function wrapTablePlugin () {
394
- return tree => {
395
- visit(tree, 'element', (node, index, parent) => {
396
- const table = node?.tagName === 'table';
397
- if (table) {
398
- const wrapper = {
399
- type: 'element',
400
- tagName: 'div',
401
- properties: {
402
- className: 'ng-doc-table-wrapper'
403
- },
404
- children: [node]
405
- };
406
- // @ts-expect-error - parent is a hast node
407
- parent.children[index] = wrapper;
408
- }
409
- });
410
- };
385
+ return (tree) => {
386
+ visit(tree, 'element', (node, index, parent) => {
387
+ const table = node?.tagName === 'table';
388
+ if (table) {
389
+ const wrapper = {
390
+ type: 'element',
391
+ tagName: 'div',
392
+ properties: {
393
+ className: 'ng-doc-table-wrapper',
394
+ },
395
+ children: [node],
396
+ };
397
+ // @ts-expect-error - parent is a hast node
398
+ parent.children[index] = wrapper;
399
+ }
400
+ });
401
+ };
411
402
  }
412
403
 
413
404
  /**
@@ -416,34 +407,37 @@ function wrapTablePlugin () {
416
407
  * @param config
417
408
  */
418
409
  async function processHtml(html, config) {
419
- const anchors = new Set();
420
- try {
421
- const content = await unified().use(rehypeParse, {
422
- fragment: true
423
- }).use(rehypeStringify).use(mermaidPlugin)
424
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
425
- // @ts-ignore
426
- .use(rehypeShiki, {
427
- defaultLanguage: 'ts',
428
- fallbackLanguage: 'text',
429
- addLanguageClass: true,
430
- parseMetaString: meta => JSON.parse(meta?.replace(/\\/g, '') || '{}'),
431
- themes: {
432
- light: config.lightTheme ?? 'github-light',
433
- dark: config.darkTheme ?? 'ayu-dark'
434
- }
435
- }).use(highlightCodeLines).use(wrapTablePlugin).use(sluggerPlugin, anchors.add.bind(anchors), config.headings).use(rehypeMinifyWhitespace).use(addHeadingAnchors, config.route).use(markElementsPlugin).process(html).then(file => file.toString());
436
- return {
437
- content,
438
- anchors: Array.from(anchors)
439
- };
440
- } catch (error) {
441
- return {
442
- content: html,
443
- anchors: [],
444
- error
445
- };
446
- }
410
+ const anchors = new Set();
411
+ try {
412
+ const content = await unified()
413
+ .use(rehypeParse, { fragment: true })
414
+ .use(rehypeStringify)
415
+ .use(mermaidPlugin)
416
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
417
+ // @ts-ignore
418
+ .use(rehypeShiki, {
419
+ defaultLanguage: 'ts',
420
+ fallbackLanguage: 'text',
421
+ addLanguageClass: true,
422
+ parseMetaString: (meta) => JSON.parse(meta?.replace(/\\/g, '') || '{}'),
423
+ themes: {
424
+ light: config.lightTheme ?? 'github-light',
425
+ dark: config.darkTheme ?? 'ayu-dark',
426
+ },
427
+ })
428
+ .use(highlightCodeLines)
429
+ .use(wrapTablePlugin)
430
+ .use(sluggerPlugin, anchors.add.bind(anchors), config.headings)
431
+ .use(rehypeMinifyWhitespace)
432
+ .use(addHeadingAnchors, config.route)
433
+ .use(markElementsPlugin)
434
+ .process(html)
435
+ .then((file) => file.toString());
436
+ return { content, anchors: Array.from(anchors) };
437
+ }
438
+ catch (error) {
439
+ return { content: html, anchors: [], error };
440
+ }
447
441
  }
448
442
 
449
443
  /**
@@ -452,19 +446,17 @@ async function processHtml(html, config) {
452
446
  * @param headings
453
447
  */
454
448
  function removeNotIndexableContentPlugin() {
455
- return tree => {
456
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
457
- // @ts-ignore
458
- return filter(tree, {
459
- cascade: true
460
- }, node => {
461
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
462
- // @ts-ignore
463
- const preWithCode = node?.tagName === 'pre' && node?.children?.some(isCodeNode);
464
- const notIndexable = node?.properties?.['indexable'] === 'false';
465
- return !node?.tagName || !preWithCode && !notIndexable;
466
- });
467
- };
449
+ return (tree) => {
450
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
451
+ // @ts-ignore
452
+ return filter(tree, { cascade: true }, (node) => {
453
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
454
+ // @ts-ignore
455
+ const preWithCode = node?.tagName === 'pre' && node?.children?.some(isCodeNode);
456
+ const notIndexable = node?.properties?.['indexable'] === 'false';
457
+ return !node?.tagName || (!preWithCode && !notIndexable);
458
+ });
459
+ };
468
460
  }
469
461
 
470
462
  /**
@@ -472,7 +464,10 @@ function removeNotIndexableContentPlugin() {
472
464
  * @param html
473
465
  */
474
466
  async function removeNotIndexableContent(html) {
475
- return rehype().use(removeNotIndexableContentPlugin).process(html).then(file => file.toString());
467
+ return rehype()
468
+ .use(removeNotIndexableContentPlugin)
469
+ .process(html)
470
+ .then((file) => file.toString());
476
471
  }
477
472
 
478
473
  /**
@@ -482,14 +477,13 @@ async function removeNotIndexableContent(html) {
482
477
  * @param config.getKeyword
483
478
  * @param getKeyword
484
479
  */
485
- async function replaceKeywords(html, {
486
- getKeyword
487
- }) {
488
- return unified().use(rehypeParse, {
489
- fragment: true
490
- }).use(rehypeStringify).use(keywordsPlugin, {
491
- getKeyword
492
- }).process(html).then(file => file.toString());
480
+ async function replaceKeywords(html, { getKeyword }) {
481
+ return unified()
482
+ .use(rehypeParse, { fragment: true })
483
+ .use(rehypeStringify)
484
+ .use(keywordsPlugin, { getKeyword })
485
+ .process(html)
486
+ .then((file) => file.toString());
493
487
  }
494
488
 
495
489
  /**
@@ -497,7 +491,7 @@ async function replaceKeywords(html, {
497
491
  * @param content
498
492
  */
499
493
  function stringifyEntities(content) {
500
- return stringifyEntities$1(content);
494
+ return stringifyEntities$1(content);
501
495
  }
502
496
 
503
497
  export { minify, postProcessHtml, processHtml, removeNotIndexableContent, replaceKeywords, stringifyEntities };
package/index.esm.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../libs/utils/html/minify.ts","../../../libs/utils/html/helpers/attr-value.ts","../../../libs/utils/html/helpers/has-class.ts","../../../libs/utils/html/helpers/has-link-ancestor.ts","../../../libs/utils/html/helpers/is-code-block.ts","../../../libs/utils/html/helpers/is-code-node.ts","../../../libs/utils/html/helpers/is-element.ts","../../../libs/utils/html/helpers/is-heading.ts","../../../libs/utils/html/plugins/keywords.plugin.ts","../../../libs/utils/html/post-process-html.ts","../../../libs/utils/html/plugins/add-heading-anchors.plugin.ts","../../../libs/utils/html/plugins/highlight-code-lines.ts","../../../libs/utils/html/plugins/mark-elements.plugin.ts","../../../libs/utils/html/plugins/mermaid.plugin.ts","../../../libs/utils/html/plugins/slugger.plugin.ts","../../../libs/utils/html/plugins/table-wrapper.ts","../../../libs/utils/html/process-html.ts","../../../libs/utils/html/plugins/remove-not-indexable-content.plugin.ts","../../../libs/utils/html/remove-not-indexable-content.ts","../../../libs/utils/html/replace-keywords.ts","../../../libs/utils/html/stringify-entities.ts"],"sourcesContent":["import rehypeMinifyWhitespace from 'rehype-minify-whitespace';\nimport rehypeParse from 'rehype-parse';\nimport rehypeStringify from 'rehype-stringify';\nimport { unified } from 'unified';\n\n/**\n *\n * @param html\n */\nexport function minify(html: string): string {\n return unified()\n .use(rehypeParse, { fragment: true })\n .use(rehypeStringify)\n .use(rehypeMinifyWhitespace)\n .processSync(html)\n .toString();\n}\n","import { Element } from 'hast';\n\n/**\n *\n * @param node\n * @param attr\n */\nexport function attrValue(node: Element, attr: string): string | undefined {\n const attrKey: string = attr.toLowerCase();\n\n return node.properties?.[attrKey] ? String(node.properties[attrKey]) : undefined;\n}\n","import { Element } from 'hast';\n\n/**\n *\n * @param node\n * @param cls\n */\nexport function hasClass(node: Element, cls: string): boolean {\n const className: string = node.properties?.['className']?.toString() ?? '';\n\n return !!className && className.includes(cls);\n}\n","import { Element } from 'hast';\nimport { isElement } from 'hast-util-is-element';\n\n/**\n *\n * @param ancestors\n */\nexport function hasLinkAncestor(ancestors: Element[]): boolean {\n return ancestors.some((ancestor: Element) => isElement(ancestor, 'a'));\n}\n","import { Element, Root } from 'hast';\n\n/**\n *\n * @param parent\n * @param node\n */\nexport function isCodeBlock(parent: Root | Element | null, node: Element): node is Element {\n return parent?.type === 'element' && parent.tagName === 'pre' && node.tagName === 'code';\n}\n","import { Element } from 'hast';\nimport { isElement } from 'hast-util-is-element';\n\n/**\n *\n * @param node\n */\nexport function isCodeNode(node: Element): boolean {\n return isElement(node, 'code') || isElement(node, 'ng-doc-code');\n}\n","import { Content, Element } from 'hast';\n\n/**\n *\n * @param node\n */\nexport function isElement(node?: Content): node is Element {\n return node?.type === 'element';\n}\n","import { Element } from 'hast';\nimport { isElement } from 'hast-util-is-element';\n\nconst HEADINGS: string[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n/**\n *\n * @param node\n */\nexport function isHeading(node: Element): boolean {\n return isElement(node, HEADINGS);\n}\n","import {\n asArray,\n KEYWORD_ALLOWED_LANGUAGES,\n NG_DOC_ELEMENT,\n NgDocKeyword,\n NgDocKeywordLanguage,\n} from '@ng-doc/core';\nimport { Element, Text } from 'hast';\nimport { isElement } from 'hast-util-is-element';\nimport { toString } from 'hast-util-to-string';\nimport { SKIP, visitParents } from 'unist-util-visit-parents';\n\nimport { hasLinkAncestor, isCodeNode } from '../helpers';\n\nconst ALWAYS_ALLOWED_LANGUAGES: string[] = ['typescript', 'ts', 'angular-ts'];\nconst LANGUAGES: string[] = ['typescript', 'ts', 'angular-ts', ...KEYWORD_ALLOWED_LANGUAGES];\nconst SPLIT_REGEXP: RegExp = /([*\\p{L}\\w$@-]+(?:[.#][\\p{L}\\w-]+)?(?:\\?[\\w=&]+)?)/u;\nconst MATCH_KEYWORD_REGEXP: RegExp =\n /(?<key>[*\\p{L}\\w$@-]+)((?<delimiter>[.#])(?<anchor>[\\p{L}\\w-]+))?(?<queryParams>\\?[\\w=&]+)?/u;\n\nexport type AddKeyword = (keyword: string) => void;\nexport type GetKeyword = (keyword: string) => NgDocKeyword | undefined;\n\ninterface Config {\n addUsedKeyword?: AddKeyword;\n getKeyword?: GetKeyword;\n}\n\n/**\n *\n * @param config\n */\nexport default function keywordsPlugin(config: Config) {\n return (tree: Element) =>\n visitParents(tree, 'element', (node: Element, ancestors: Element[]) => {\n if (!isCodeNode(node)) {\n return;\n }\n\n const isInlineCode: boolean = !isElement(ancestors[ancestors.length - 1], 'pre');\n const lang =\n asArray((node.properties?.['className'] as string[]) ?? [])\n .find((className) => className.startsWith('language-'))\n ?.replace('language-', '') ?? '';\n\n if (isInlineCode || LANGUAGES.includes(lang)) {\n visitParents(node, 'text', (node: Text, ancestors: Element[]) => {\n if (hasLinkAncestor(ancestors)) {\n return;\n }\n\n const parent: Element = ancestors[ancestors.length - 1];\n const index: number = parent.children.indexOf(node);\n\n // Parse the text for words that we can convert to links\n const nodes: any[] = getNodes(node, parent, isInlineCode, config, lang);\n // Replace the text node with the links and leftover text nodes\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Array.prototype.splice.apply(parent.children, [index, 1].concat(nodes));\n // Do not visit this node's children or the newly added nodes\n return [SKIP, index + nodes.length];\n });\n }\n });\n}\n\n/**\n *\n * @param node\n * @param parent\n * @param isInlineCode\n * @param config\n * @param language\n */\nfunction getNodes(\n node: Text,\n parent: Element,\n isInlineCode: boolean,\n config: Config,\n language: string,\n): Array<Element | Text> {\n const { addUsedKeyword, getKeyword } = config;\n\n return toString(node)\n .split(SPLIT_REGEXP)\n .map((word: string) => {\n const match = word.match(MATCH_KEYWORD_REGEXP);\n\n if (!match) {\n return { type: 'text', value: word };\n }\n\n const {\n key = '',\n delimiter = '',\n anchor = '',\n queryParams = '',\n } = match.groups as { key: string; delimiter: string; anchor: string; queryParams: string };\n const usedKeyword = `${key}${delimiter}${anchor?.toLowerCase()}`;\n const rootKeyword = getKeyword?.(key);\n const keyword = getKeyword?.(usedKeyword);\n const isGuideKeyword = key.startsWith('*');\n const isLanguageAllowed =\n (!keyword?.languages && ALWAYS_ALLOWED_LANGUAGES.includes(language)) ||\n !!keyword?.languages?.includes(language as NgDocKeywordLanguage);\n\n // If language of code block is not allowed, return the word as is\n if (!isInlineCode && keyword && !isLanguageAllowed) {\n return { type: 'text', value: word };\n }\n\n // If the keyword is just an asterisk, return the word as is\n if (isGuideKeyword && key.length === 1) {\n return { type: 'text', value: word };\n }\n\n addUsedKeyword?.(usedKeyword);\n\n const notFoundGuideKeyword: boolean = isGuideKeyword && !keyword;\n const notFoundApiAnchorKeyword: boolean = !!rootKeyword && !!anchor && !keyword;\n\n if (getKeyword && isInlineCode && (notFoundGuideKeyword || notFoundApiAnchorKeyword)) {\n throw new Error(`Route with keyword \"${word}\" is missing.`);\n }\n\n // Convert code tag to a link tag or highlight it with a class\n if (parent.properties) {\n if (isInlineCode && keyword?.type === 'link') {\n parent.tagName = 'a';\n parent.properties = {\n href: `${keyword.path}${queryParams ?? ''}`,\n className: [NG_DOC_ELEMENT],\n };\n\n return { type: 'text', value: keyword.title };\n } else if (isInlineCode && keyword) {\n parent.properties['className'] = [NG_DOC_ELEMENT, 'ng-doc-code-with-link'];\n }\n }\n\n // Add link inside the code if it's a link to the API entity\n return keyword\n ? createLinkNode(\n isInlineCode ? keyword.title : word,\n keyword.path,\n keyword.type,\n keyword.description,\n )\n : { type: 'text', value: word };\n });\n}\n\n/**\n *\n * @param text\n * @param href\n * @param type\n * @param description\n */\nfunction createLinkNode(text: string, href: string, type?: string, description?: string): Element {\n return {\n type: 'element',\n tagName: 'a',\n properties: {\n href: href,\n class: ['ng-doc-code-anchor', NG_DOC_ELEMENT],\n 'data-link-type': type,\n ngDocTooltip: description,\n },\n children: [{ type: 'text', value: text }],\n };\n}\n","import rehypeParse from 'rehype-parse';\nimport rehypeStringify from 'rehype-stringify';\nimport { unified } from 'unified';\n\nimport keywordsPlugin from './plugins/keywords.plugin';\n\nexport interface PostProcessHtmlOutput {\n content: string;\n usedKeywords: string[];\n error?: unknown;\n}\n\n/**\n *\n * @param html\n * @param config\n * @param config.addUsedKeyword\n * @param addUsedKeyword\n */\nexport async function postProcessHtml(html: string): Promise<PostProcessHtmlOutput> {\n const usedKeywords = new Set<string>();\n\n try {\n const content = await unified()\n .use(rehypeParse, { fragment: true })\n .use(rehypeStringify)\n .use(keywordsPlugin, { addUsedKeyword: usedKeywords.add.bind(usedKeywords) })\n .process(html)\n .then((file) => file.toString());\n\n return { content, usedKeywords: Array.from(usedKeywords) };\n } catch (error) {\n return { content: html, usedKeywords: [], error };\n }\n}\n","import { Element, Root } from 'hast';\nimport { visit } from 'unist-util-visit';\n\nimport { hasClass, isHeading } from '../helpers';\n\nconst NO_ANCHOR_CLASS: string = 'no-anchor';\n\n/**\n *\n * @param options\n * @param route\n */\nexport default function addHeadingAnchors(route?: string): any {\n return (tree: Root) =>\n visit(tree, 'element', (node: Element) => {\n if (\n route &&\n isHeading(node) &&\n node.properties &&\n node.properties['id'] &&\n !hasClass(node, NO_ANCHOR_CLASS)\n ) {\n node.children.push({\n type: 'element',\n tagName: 'ng-doc-heading-anchor',\n properties: {\n className: ['ng-doc-anchor'],\n anchor: node.properties['id'],\n },\n children: [],\n });\n\n node.properties = {\n ...node.properties,\n href: route,\n headingLink: 'true',\n };\n }\n });\n}\n","import { Element, Root } from 'hast';\nimport { visit } from 'unist-util-visit';\n\nimport { attrValue, isCodeBlock, isElement } from '../helpers';\n\n/**\n * Highlight code lines\n */\nexport default function highlightCodeLines() {\n return (tree: Root) => {\n visit(tree, 'element', (node: Element, _i, parent: Root | Element | null) => {\n if (isCodeBlock(parent, node) && parent?.type === 'element') {\n const highlightedLines: number[] = JSON.parse(\n attrValue(parent, 'highlightedLines') ?? '[]',\n );\n\n highlightedLines.length &&\n node.children.filter(isElement).forEach((child: Element, i: number) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (child.properties.class === 'line' && highlightedLines.includes(i + 1)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n child.properties.class = 'line highlighted';\n }\n });\n }\n });\n };\n}\n","import { asArray, NG_DOC_ELEMENT } from '@ng-doc/core';\nimport { Element, Root } from 'hast';\nimport { visit } from 'unist-util-visit';\n\n/**\n * Marks all elements with the NG_DOC_ELEMENT class name\n * @param tree\n * @param headings\n */\nexport default function markElementsPlugin(): any {\n return (tree: Root) => {\n visit(tree, 'element', (node: Element) => {\n if (node.properties) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n node.properties['className'] = [...asArray(node.properties.className), NG_DOC_ELEMENT];\n }\n });\n };\n}\n","import { Element, Root } from 'hast';\nimport { toString } from 'hast-util-to-string';\nimport { visit } from 'unist-util-visit';\n\n/**\n * Plugin to transform mermaid code blocks into mermaid elements that are going to be rendered by the mermaid processor.\n * @param tree\n * @param headings\n */\nexport default function mermaidPlugin(): any {\n return (tree: Root) => {\n visit(tree, 'element', (node: Element) => {\n if (node.tagName === 'pre') {\n const codeNode = node.children[0] as Element;\n\n if (codeNode.tagName === 'code' && codeNode.properties?.['lang'] === 'mermaid') {\n node.properties = { className: 'mermaid' };\n node.children = [\n {\n type: 'text',\n value: toString(codeNode),\n },\n ];\n }\n }\n });\n };\n}\n","import { NgDocHeading, NgDocPageAnchor, NgDocScopedKeyword } from '@ng-doc/core';\nimport GithubSlugger from 'github-slugger';\nimport { Element, Root } from 'hast';\nimport { hasProperty } from 'hast-util-has-property';\nimport { headingRank } from 'hast-util-heading-rank';\nimport { isElement } from 'hast-util-is-element';\nimport { toString } from 'hast-util-to-string';\nimport { visitParents } from 'unist-util-visit-parents';\n\nimport { attrValue } from '../helpers';\n\n/**\n *\n * @param tree\n * @param addAnchor\n * @param headings\n */\nexport default function sluggerPlugin(\n addAnchor?: (anchor: NgDocPageAnchor) => void,\n headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4'],\n) {\n if (!addAnchor) {\n return () => {};\n }\n\n const slugger: GithubSlugger = new GithubSlugger();\n\n return (tree: Root) => {\n slugger.reset();\n\n visitParents(tree, 'element', (node: Element, ancestors) => {\n const scope = getKeywordScope(ancestors);\n\n const isHeading =\n !!headingRank(node) &&\n !hasProperty(node, 'id') &&\n !!headings?.includes(node.tagName.toLowerCase() as NgDocHeading);\n const attrSlug: string | undefined = attrValue(node, 'dataSlug');\n const attrSlugTitle: string | undefined = attrValue(node, 'dataSlugTitle');\n const attrSlugType: string | undefined = attrValue(node, 'dataSlugType');\n const dataToSlug: string | undefined = isHeading ? toString(node).trim() : attrSlug;\n\n if (dataToSlug) {\n if (node.properties) {\n const id: string =\n attrSlug && attrSlugType === 'member' ? attrSlug : slugger.slug(dataToSlug);\n\n node.properties['id'] = id;\n\n addAnchor({\n anchorId: id,\n anchor: new GithubSlugger().slug(dataToSlug),\n title: attrSlugTitle || dataToSlug,\n scope,\n type:\n (isHeading && attrSlugType !== 'member') || (attrSlug && attrSlugType === 'heading')\n ? 'heading'\n : 'member',\n });\n }\n }\n });\n };\n}\n\n/**\n *\n * @param ancestors\n */\nfunction getKeywordScope(ancestors: Array<Root | Element>): NgDocScopedKeyword | undefined {\n const keywordScope = ancestors.find(\n (ancestor) => isElement(ancestor) && ancestor.tagName === 'ng-doc-keyword-scope',\n ) as Element | undefined;\n const key = keywordScope?.properties?.['id'];\n\n return key\n ? {\n key: String(key),\n title: String(keywordScope?.properties?.['title']),\n }\n : undefined;\n}\n","import { Element, Root } from 'hast';\nimport { visit } from 'unist-util-visit';\n\n/**\n *\n */\nexport default function (): any {\n return (tree: Root) => {\n visit(tree, 'element', (node: Element, index, parent) => {\n const table: boolean = node?.tagName === 'table';\n\n if (table) {\n const wrapper = {\n type: 'element',\n tagName: 'div',\n properties: {\n className: 'ng-doc-table-wrapper',\n },\n children: [node],\n };\n\n // @ts-expect-error - parent is a hast node\n parent.children[index] = wrapper;\n }\n });\n };\n}\n","import { NgDocHeading, NgDocPageAnchor } from '@ng-doc/core';\nimport rehypeShiki from '@shikijs/rehype';\nimport rehypeMinifyWhitespace from 'rehype-minify-whitespace';\nimport rehypeParse from 'rehype-parse';\nimport rehypeStringify from 'rehype-stringify';\nimport { unified } from 'unified';\n\nimport autolinkHeadingPlugin from './plugins/add-heading-anchors.plugin';\nimport highlightCodeLines from './plugins/highlight-code-lines';\nimport markElementsPlugin from './plugins/mark-elements.plugin';\nimport mermaidPlugin from './plugins/mermaid.plugin';\nimport sluggerPlugin from './plugins/slugger.plugin';\nimport wrapTablePlugin from './plugins/table-wrapper';\n\nexport interface NgDocHtmlProcessorConfig {\n lightTheme?: string;\n darkTheme?: string;\n headings?: NgDocHeading[];\n route?: string;\n}\n\nexport interface NgDocHtmlProcessorOutput {\n content: string;\n anchors: NgDocPageAnchor[];\n error?: unknown;\n}\n\n/**\n *\n * @param html\n * @param config\n */\nexport async function processHtml(\n html: string,\n config: NgDocHtmlProcessorConfig,\n): Promise<NgDocHtmlProcessorOutput> {\n const anchors = new Set<NgDocPageAnchor>();\n\n try {\n const content = await unified()\n .use(rehypeParse, { fragment: true })\n .use(rehypeStringify)\n .use(mermaidPlugin)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .use(rehypeShiki, {\n defaultLanguage: 'ts',\n fallbackLanguage: 'text',\n addLanguageClass: true,\n parseMetaString: (meta: string) => JSON.parse(meta?.replace(/\\\\/g, '') || '{}'),\n themes: {\n light: config.lightTheme ?? 'github-light',\n dark: config.darkTheme ?? 'ayu-dark',\n },\n })\n .use(highlightCodeLines)\n .use(wrapTablePlugin)\n .use(sluggerPlugin, anchors.add.bind(anchors), config.headings)\n .use(rehypeMinifyWhitespace)\n .use(autolinkHeadingPlugin, config.route)\n .use(markElementsPlugin)\n .process(html)\n .then((file) => file.toString());\n\n return { content, anchors: Array.from(anchors) };\n } catch (error) {\n return { content: html, anchors: [], error };\n }\n}\n","import { Element, Root } from 'hast';\nimport { filter } from 'unist-util-filter';\n\nimport { isCodeNode } from '../helpers';\n\n/**\n *\n * @param tree\n * @param headings\n */\nexport default function removeNotIndexableContentPlugin(): any {\n return (tree: Root) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return filter(tree, { cascade: true }, (node: Element) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const preWithCode: boolean = node?.tagName === 'pre' && node?.children?.some(isCodeNode);\n const notIndexable: boolean = node?.properties?.['indexable'] === 'false';\n\n return !node?.tagName || (!preWithCode && !notIndexable);\n });\n };\n}\n","import { rehype } from 'rehype';\n\nimport removeNotIndexableContentPlugin from './plugins/remove-not-indexable-content.plugin';\n\n/**\n *\n * @param html\n */\nexport async function removeNotIndexableContent(html: string): Promise<string> {\n return rehype()\n .use(removeNotIndexableContentPlugin)\n .process(html)\n .then((file) => file.toString());\n}\n","import rehypeParse from 'rehype-parse';\nimport rehypeStringify from 'rehype-stringify';\nimport { unified } from 'unified';\n\nimport keywordsPlugin, { GetKeyword } from './plugins/keywords.plugin';\n\nexport interface ReplaceKeywordsConfig {\n getKeyword: GetKeyword;\n}\n\n/**\n *\n * @param html\n * @param config\n * @param config.getKeyword\n * @param getKeyword\n */\nexport async function replaceKeywords(\n html: string,\n { getKeyword }: ReplaceKeywordsConfig,\n): Promise<string> {\n return unified()\n .use(rehypeParse, { fragment: true })\n .use(rehypeStringify)\n .use(keywordsPlugin, { getKeyword })\n .process(html)\n .then((file) => file.toString());\n}\n","import { stringifyEntities as stringify } from 'stringify-entities';\n\n/**\n *\n * @param content\n */\nexport function stringifyEntities(content: string): string {\n return stringify(content);\n}\n"],"names":["minify","html","unified","use","rehypeParse","fragment","rehypeStringify","rehypeMinifyWhitespace","processSync","toString","attrValue","node","attr","attrKey","toLowerCase","properties","String","undefined","hasClass","cls","className","includes","hasLinkAncestor","ancestors","some","ancestor","isElement","isCodeBlock","parent","type","tagName","isCodeNode","HEADINGS","isHeading","ALWAYS_ALLOWED_LANGUAGES","LANGUAGES","KEYWORD_ALLOWED_LANGUAGES","SPLIT_REGEXP","MATCH_KEYWORD_REGEXP","keywordsPlugin","config","tree","visitParents","isInlineCode","length","lang","asArray","find","startsWith","replace","index","children","indexOf","nodes","getNodes","Array","prototype","splice","apply","concat","SKIP","language","addUsedKeyword","getKeyword","split","map","word","match","value","key","delimiter","anchor","queryParams","groups","usedKeyword","rootKeyword","keyword","isGuideKeyword","isLanguageAllowed","languages","notFoundGuideKeyword","notFoundApiAnchorKeyword","Error","href","path","NG_DOC_ELEMENT","title","createLinkNode","description","text","class","ngDocTooltip","postProcessHtml","usedKeywords","Set","content","add","bind","process","then","file","from","error","NO_ANCHOR_CLASS","addHeadingAnchors","route","visit","push","headingLink","highlightCodeLines","_i","highlightedLines","JSON","parse","filter","forEach","child","i","markElementsPlugin","mermaidPlugin","codeNode","sluggerPlugin","addAnchor","headings","slugger","GithubSlugger","reset","scope","getKeywordScope","headingRank","hasProperty","attrSlug","attrSlugTitle","attrSlugType","dataToSlug","trim","id","slug","anchorId","keywordScope","table","wrapper","processHtml","anchors","rehypeShiki","defaultLanguage","fallbackLanguage","addLanguageClass","parseMetaString","meta","themes","light","lightTheme","dark","darkTheme","wrapTablePlugin","autolinkHeadingPlugin","removeNotIndexableContentPlugin","cascade","preWithCode","notIndexable","removeNotIndexableContent","rehype","replaceKeywords","stringifyEntities","stringify"],"mappings":";;;;;;;;;;;;;;;;;AAKA;;;AAGG;AACG,SAAUA,MAAMA,CAACC,IAAY,EAAA;AACjC,EAAA,OAAOC,OAAO,EAAE,CACbC,GAAG,CAACC,WAAW,EAAE;AAAEC,IAAAA,QAAQ,EAAE;GAAM,CAAC,CACpCF,GAAG,CAACG,eAAe,CAAC,CACpBH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pCF,GAAG,CAACG,eAAe,CAAC,CACpBH,GAAG,CAACoC,cAAc,EAAE;AAAEwB,IAAAA;GAAY,CAAC,CACnCmC,OAAO,CAACjG,IAAI,CAAC,CACbkG,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAAC3F,QAAQ,EAAE,CAAC;AACpC;;ACzBA;;;AAGG;AACG,SAAU2J,iBAAiBA,CAACrE,OAAe,EAAA;EAC/C,OAAOsE,mBAAS,CAACtE,OAAO,CAAC;AAC3B;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../../libs/utils/html/minify.ts","../../../../libs/utils/html/helpers/attr-value.ts","../../../../libs/utils/html/helpers/has-class.ts","../../../../libs/utils/html/helpers/has-link-ancestor.ts","../../../../libs/utils/html/helpers/is-code-block.ts","../../../../libs/utils/html/helpers/is-code-node.ts","../../../../libs/utils/html/helpers/is-element.ts","../../../../libs/utils/html/helpers/is-heading.ts","../../../../libs/utils/html/plugins/keywords.plugin.ts","../../../../libs/utils/html/post-process-html.ts","../../../../libs/utils/html/plugins/add-heading-anchors.plugin.ts","../../../../libs/utils/html/plugins/highlight-code-lines.ts","../../../../libs/utils/html/plugins/mark-elements.plugin.ts","../../../../libs/utils/html/plugins/mermaid.plugin.ts","../../../../libs/utils/html/plugins/slugger.plugin.ts","../../../../libs/utils/html/plugins/table-wrapper.ts","../../../../libs/utils/html/process-html.ts","../../../../libs/utils/html/plugins/remove-not-indexable-content.plugin.ts","../../../../libs/utils/html/remove-not-indexable-content.ts","../../../../libs/utils/html/replace-keywords.ts","../../../../libs/utils/html/stringify-entities.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["isElement","autolinkHeadingPlugin","stringify"],"mappings":";;;;;;;;;;;;;;;;;AAKA;;;AAGG;AACG,SAAU,MAAM,CAAC,IAAY,EAAA;AACjC,IAAA,OAAO,OAAO;SACX,GAAG,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAA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