mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Update MD031/blanks-around-fences and MD032/blanks-around-lists to ignore comments and blockquotes (fixes #171, fixes #172).
This commit is contained in:
parent
df2507f030
commit
1db87ef0c6
5 changed files with 120 additions and 16 deletions
|
|
@ -64,6 +64,13 @@ module.exports.isEmptyString = function isEmptyString(str) {
|
|||
return str.length === 0;
|
||||
};
|
||||
|
||||
// Returns true iff the input line is blank (no content)
|
||||
// Example: Contains nothing, whitespace, or comments
|
||||
const blankLineRe = />|(?:<!--.*?-->)/g;
|
||||
module.exports.isBlankLine = function isBlankLine(line) {
|
||||
return !line || !line.trim() || !line.replace(blankLineRe, "").trim();
|
||||
};
|
||||
|
||||
// Replaces the text of all properly-formatted HTML comments with whitespace
|
||||
// This preserves the line/column information for the rest of the document
|
||||
// Trailing whitespace is avoided with a '\' character in the last column
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue