mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Allow overlapping and differently-cased names for MD044/proper-names (fixes #60).
This commit is contained in:
parent
d63143b38e
commit
edd426bbaa
4 changed files with 75 additions and 3 deletions
11
lib/rules.js
11
lib/rules.js
|
@ -1157,9 +1157,14 @@ module.exports = [
|
|||
.forEach(function forLine(line, index) {
|
||||
var match = null;
|
||||
while ((match = anyNameRe.exec(line)) !== null) {
|
||||
if (!bareUrlRe.test(match[0])) {
|
||||
var lineNumber = token.lineNumber + index + fenceOffset;
|
||||
errors.addDetailIf(lineNumber, name, match[1]);
|
||||
var fullMatch = match[0];
|
||||
if (!bareUrlRe.test(fullMatch)) {
|
||||
var wordMatch = fullMatch
|
||||
.replace(/^\W*/, "").replace(/\W*$/, "");
|
||||
if (names.indexOf(wordMatch) === -1) {
|
||||
var lineNumber = token.lineNumber + index + fenceOffset;
|
||||
errors.addDetailIf(lineNumber, name, match[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue