Skip to content

Commit

Permalink
Make MD020 not to check HTML blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
fyc09 committed Jul 17, 2024
1 parent 1059aa6 commit 6202df9
Show file tree
Hide file tree
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
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/md020.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 9 additions & 3 deletions test/ignore-html-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 6202df9

Please sign in to comment.