mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Update MD033/no-inline-html to handle escaped backticks (fixes #193).
This commit is contained in:
parent
5a142da87c
commit
73e70b76f3
2 changed files with 12 additions and 1 deletions
|
|
@ -31,7 +31,8 @@ module.exports = {
|
||||||
!emailAddressRe.test(content)) {
|
!emailAddressRe.test(content)) {
|
||||||
const prefix = line.substring(0, match.index);
|
const prefix = line.substring(0, match.index);
|
||||||
if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix) &&
|
if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix) &&
|
||||||
!unescapeMarkdown(prefix + "<", "_").endsWith("_")) {
|
!unescapeMarkdown(prefix + "<", "_").endsWith("_") &&
|
||||||
|
(unescapeMarkdown(prefix + "`", "_").match(/`/g).length % 2)) {
|
||||||
addError(onError, lineIndex + 1, "Element: " + element,
|
addError(onError, lineIndex + 1, "Element: " + element,
|
||||||
null, [ match.index + 1, tag.length ]);
|
null, [ match.index + 1, tag.length ]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,13 @@ but this time on multiple lines
|
||||||
```text
|
```text
|
||||||
<p>Neither should this as it's also in a code block {MD046:11}</p>
|
<p>Neither should this as it's also in a code block {MD046:11}</p>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Elements in code spans
|
||||||
|
|
||||||
|
Text `<code>` text \` text
|
||||||
|
Text \` text `<code>` text
|
||||||
|
Text \` text \` text `<code>` text
|
||||||
|
Text \` text `<code>` text `<code>` text
|
||||||
|
Text \` text `<code>` text \` text `<code>` text
|
||||||
|
Text \`\` text `<code>` text
|
||||||
|
Text `<code>` text \` text `<code>` text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue