Handle case where token map extends beyond last line of input (fixes #166).

This commit is contained in:
David Anson 2019-02-13 19:52:34 -08:00
parent 90bd0810e7
commit 3e753636cf
2 changed files with 30 additions and 1 deletions

View file

@ -2628,3 +2628,32 @@ module.exports.markdownItPluginsMathjax =
test.done();
});
};
module.exports.markdownItPluginsMathjaxIssue166 =
function markdownItPluginsMathjaxIssue166(test) {
test.expect(2);
markdownlint({
"strings": {
"string":
`## Heading
$$
1
$$$$
2
$$`
},
"markdownItPlugins": [ [ pluginKatex ] ],
"resultVersion": 0
}, function callback(err, actual) {
test.ifError(err);
const expected = {
"string": {
"MD002": [ 1 ],
"MD041": [ 1 ]
}
};
test.deepEqual(actual, expected, "Unexpected issues.");
test.done();
});
};