feat: support columns numbers (and line range) in links fragments

Fixes #7
This commit is contained in:
2024-05-27 22:26:21 +02:00
parent 2df95e97d8
commit 450cdb84f0
7 changed files with 123 additions and 23 deletions

View File

@@ -4,6 +4,8 @@ const { getHtmlAttributeRe } = require("./markdownlint-rule-helpers/helpers.js")
const markdownIt = new MarkdownIt({ html: true })
const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/
/**
* Converts a Markdown heading into an HTML fragment according to the rules
* used by GitHub.
@@ -151,6 +153,7 @@ const getLineNumberStringFromFragment = (fragment) => {
}
module.exports = {
lineFragmentRe,
convertHeadingToHTMLFragment,
getMarkdownHeadings,
getMarkdownIdOrAnchorNameFragments,