Skip to content

Commit

Permalink
Fix detection of Contents header if it includes an HTML comment (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Oct 2, 2023
1 parent 5ac0758 commit a9c66b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rules/list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = rule('remark-lint:awesome-list-item', (ast, file) => {
const toc = find(ast, node => (
node.type === 'heading' &&
node.depth === 2 &&
toString(node) === 'Contents'
toString(node).replace(/<!--.*?-->/g, '').trim() === 'Contents'
));

if (toc) {
Expand Down
2 changes: 1 addition & 1 deletion rules/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = rule('remark-lint:awesome-toc', (ast, file) => {
const toc = find(ast, node => (
node.type === 'heading' &&
node.depth === 2 &&
toString(node).trim() === 'Contents'
toString(node).replace(/<!--.*?-->/g, '').trim() === 'Contents'
));

if (!toc) {
Expand Down

0 comments on commit a9c66b3

Please sign in to comment.