mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD037/no-space-in-emphasis to avoid hang when backtracking for embedded emphasis on first character of line.
This commit is contained in:
parent
8c79b48855
commit
26e70a2c6d
2 changed files with 19 additions and 1 deletions
|
|
@ -128,7 +128,9 @@ module.exports = {
|
||||||
}
|
}
|
||||||
// Back up one character so RegExp has a chance to match the
|
// Back up one character so RegExp has a chance to match the
|
||||||
// next marker (ex: "**star**_underscore_")
|
// next marker (ex: "**star**_underscore_")
|
||||||
emphasisRe.lastIndex--;
|
if (emphasisRe.lastIndex > 1) {
|
||||||
|
emphasisRe.lastIndex--;
|
||||||
|
}
|
||||||
} else if (emphasisRe.lastIndex > 1) {
|
} else if (emphasisRe.lastIndex > 1) {
|
||||||
// Back up one character so RegExp has a chance to match the
|
// Back up one character so RegExp has a chance to match the
|
||||||
// mis-matched marker (ex: "*text_*")
|
// mis-matched marker (ex: "*text_*")
|
||||||
|
|
|
||||||
|
|
@ -297,3 +297,19 @@ text [reference*link] star * star text
|
||||||
|
|
||||||
[reference_link]: https://example.com
|
[reference_link]: https://example.com
|
||||||
[reference*link]: https://example.com
|
[reference*link]: https://example.com
|
||||||
|
|
||||||
|
***text
|
||||||
|
*text*
|
||||||
|
***
|
||||||
|
|
||||||
|
*** text
|
||||||
|
*text*
|
||||||
|
***
|
||||||
|
|
||||||
|
*** text
|
||||||
|
\*text\*
|
||||||
|
***
|
||||||
|
|
||||||
|
*** text
|
||||||
|
**text**
|
||||||
|
***
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue