mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Refine previous commit for MD051/link-fragments to tweak behavior, tests, and documentation.
This commit is contained in:
parent
242b35f98f
commit
45c8766eda
8 changed files with 259 additions and 148 deletions
|
|
@ -11,6 +11,7 @@ const { filterByPredicate, filterByTypes, getHtmlTagInfo } =
|
|||
const idRe = getHtmlAttributeRe("id");
|
||||
const nameRe = getHtmlAttributeRe("name");
|
||||
const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu;
|
||||
const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/;
|
||||
|
||||
// Sets for filtering heading tokens during conversion
|
||||
const childrenExclude = new Set([ "image", "reference", "resource" ]);
|
||||
|
|
@ -120,7 +121,6 @@ module.exports = {
|
|||
const { endColumn, startColumn } = definition;
|
||||
const text = unescapeStringTokenText(definition);
|
||||
const encodedText = `#${encodeURIComponent(text.slice(1))}`;
|
||||
const lineFragmentRe = /^#L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?$/;
|
||||
if (
|
||||
(text.length > 1) &&
|
||||
text.startsWith("#") &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue