Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tools/doc/json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,23 @@
const leadingHyphen = /^-\s*/;
const defaultExpr = /\s*\*\*Default:\*\*\s*([^]+)$/i;

function replaceAllHtmlComments(str) {

Check failure on line 374 in tools/doc/json.mjs

View workflow job for this annotation

GitHub Actions / lint-js-and-md

'replaceAllHtmlComments' is defined but never used
let prev;
do {
prev = str;
str = str.replace(/<!--.*?-->/sg, '');
} while (str !== prev);
return str;
}

function parseListItem(item, file) {
const current = {};

current.textRaw = item.children.filter((node) => node.type !== 'list')
.map((node) => (
file.value.slice(node.position.start.offset, node.position.end.offset)),
)
.join('').replace(/\s+/g, ' ').replace(/<!--.*?-->/sg, '');
.join('').replace(/\s+/g, ' ').replaceAllHtmlComments('');
let text = current.textRaw;

if (!text) {
Expand Down
Loading