mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Update MD025/single-title and MD051/link-fragments to ignore headings that exactly match Docfx tab syntax (fixes #1099) (fixes #1101).
This commit is contained in:
parent
a4b7ffa8ce
commit
6adfaf68b5
6 changed files with 115 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// @ts-check
|
||||
|
||||
import { addError, getHtmlAttributeRe } from "../helpers/helpers.cjs";
|
||||
import { filterByPredicate, filterByTypes, getHtmlTagInfo } from "../helpers/micromark-helpers.cjs";
|
||||
import { filterByPredicate, filterByTypes, getHtmlTagInfo, isDocfxTab } from "../helpers/micromark-helpers.cjs";
|
||||
import { filterByTypesCached } from "./cache.mjs";
|
||||
|
||||
// Regular expression for identifying HTML anchor names
|
||||
|
|
@ -110,7 +110,10 @@ export default {
|
|||
[ "definition", "definitionDestinationString" ]
|
||||
];
|
||||
for (const [ parentType, definitionType ] of parentChilds) {
|
||||
const links = filterByTypesCached([ parentType ]);
|
||||
const links = filterByTypesCached([ parentType ])
|
||||
.filter(
|
||||
(link) => !((link.parent?.type === "atxHeadingText") && isDocfxTab(link.parent.parent))
|
||||
);
|
||||
for (const link of links) {
|
||||
const definitions = filterByTypes(link.children, [ definitionType ]);
|
||||
for (const definition of definitions) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue