mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Update MD044/proper-names to add html_elements parameter (fixes #435).
This commit is contained in:
parent
8afec14376
commit
0f845e9ba1
15 changed files with 186 additions and 14 deletions
|
|
@ -1283,3 +1283,43 @@ test("forEachLink", (t) => {
|
|||
t.is(matches.length, 0, "Missing match");
|
||||
}
|
||||
});
|
||||
|
||||
test("htmlElementRanges", (t) => {
|
||||
t.plan(1);
|
||||
const params = {
|
||||
"lines": [
|
||||
"# Heading",
|
||||
"",
|
||||
"Text text text",
|
||||
"text <a id='id'/> text",
|
||||
"text text text",
|
||||
"",
|
||||
"<p>",
|
||||
"Text <em>text</em> text",
|
||||
"</p>",
|
||||
"",
|
||||
"```",
|
||||
"<br/>",
|
||||
"```",
|
||||
"",
|
||||
"Text `<br/>` text",
|
||||
"text <br/> text"
|
||||
],
|
||||
"tokens": [
|
||||
{
|
||||
"type": "code_block",
|
||||
"map": [ 10, 12 ]
|
||||
}
|
||||
]
|
||||
};
|
||||
const expected = [
|
||||
[ 3, 5, 12 ],
|
||||
[ 6, 0, 3 ],
|
||||
[ 7, 5, 4 ],
|
||||
[ 14, 6, 5 ],
|
||||
[ 15, 5, 5 ]
|
||||
];
|
||||
const lineMetadata = helpers.getLineMetadata(params);
|
||||
const actual = helpers.htmlElementRanges(params, lineMetadata);
|
||||
t.deepEqual(actual, expected);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue