Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore HTML blocks in MD020.
Browse files Browse the repository at this point in the history
fyc09 committed Jul 18, 2024

Verified

This commit was signed with the committer’s verified signature.
ssbarnea Sorin Sbarnea
1 parent 865b5ae commit c5b9c27
Showing 5 changed files with 25,479 additions and 25,377 deletions.
4 changes: 2 additions & 2 deletions demo/markdownlint-browser.js
Original file line number Diff line number Diff line change
@@ -4359,8 +4359,8 @@ module.exports = {
"tags": [ "headings", "atx_closed", "spaces" ],
"parser": "none",
"function": function MD020(params, onError) {
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
if (!inCode) {
forEachLine(lineMetadata(), (line, lineIndex, inCode, inFence, inTable, inItem, inBreak, inHTML) => {
if (!inCode && !inHTML) {
const match =
/^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line);
if (match) {
4 changes: 2 additions & 2 deletions lib/md020.js
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ module.exports = {
"tags": [ "headings", "atx_closed", "spaces" ],
"parser": "none",
"function": function MD020(params, onError) {
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
if (!inCode) {
forEachLine(lineMetadata(), (line, lineIndex, inCode, inFence, inTable, inItem, inBreak, inHTML) => {
if (!inCode && !inHTML) {
const match =
/^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line);
if (match) {
12 changes: 9 additions & 3 deletions test/ignore-html-block.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,12 @@

##Title2 {MD018}

<style> {MD033}
#foo {}
</style>
<div> {MD033}
#foo
</div>

##Title3 {MD020}##

<div> {MD033}
#foo#
</div>
Loading

0 comments on commit c5b9c27

Please sign in to comment.