mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update MD037 to handle violations at the start/end of a line.
This commit is contained in:
parent
4d436be500
commit
dd3bd3d7ee
2 changed files with 36 additions and 2 deletions
|
@ -11,10 +11,10 @@ module.exports = {
|
|||
"function": function MD037(params, onError) {
|
||||
shared.forEachInlineChild(params, "text", function forToken(token) {
|
||||
let left = true;
|
||||
let match = /\s(\*\*?|__?)\s.+\1/.exec(token.content);
|
||||
let match = /(?:^|\s)(\*\*?|__?)\s.+\1/.exec(token.content);
|
||||
if (!match) {
|
||||
left = false;
|
||||
match = /(\*\*?|__?).+\s\1\s/.exec(token.content);
|
||||
match = /(\*\*?|__?).+\s\1(?:\s|$)/.exec(token.content);
|
||||
}
|
||||
if (match) {
|
||||
const text = match[0].trim();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue