From 0afedaebf4e2157ecf85f0a6370890e33476af43 Mon Sep 17 00:00:00 2001 From: David Anson Date: Mon, 16 Oct 2023 20:06:30 -0700 Subject: [PATCH] Resolve new eslint-plugin-regexp violation regexp/no-contradiction-with-assertion. --- README.md | 2 +- demo/markdownlint-browser.js | 2 +- helpers/helpers.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2f032250..7f06e01e 100644 --- a/README.md +++ b/README.md @@ -518,7 +518,7 @@ specify a custom `RegExp` or use the value `null` to disable the feature. The default value: ```javascript -/((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m +/((^---\s*$[\s\S]+?^---\s*)|(^\+\+\+\s*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m ``` Ignores [YAML](https://en.wikipedia.org/wiki/YAML), diff --git a/demo/markdownlint-browser.js b/demo/markdownlint-browser.js index 934999e7..02e42707 100644 --- a/demo/markdownlint-browser.js +++ b/demo/markdownlint-browser.js @@ -52,7 +52,7 @@ module.exports.newLineRe = newLineRe; // Regular expression for matching common front matter (YAML and TOML) module.exports.frontMatterRe = // eslint-disable-next-line max-len -/((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m; +/((^---\s*$[\s\S]+?^---\s*)|(^\+\+\+\s*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m; // Regular expression for matching the start of inline disable/enable comments var inlineCommentStartRe = diff --git a/helpers/helpers.js b/helpers/helpers.js index b4dc2f77..66e1e33a 100644 --- a/helpers/helpers.js +++ b/helpers/helpers.js @@ -10,7 +10,7 @@ module.exports.newLineRe = newLineRe; // Regular expression for matching common front matter (YAML and TOML) module.exports.frontMatterRe = // eslint-disable-next-line max-len - /((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m; + /((^---\s*$[\s\S]+?^---\s*)|(^\+\+\+\s*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m; // Regular expression for matching the start of inline disable/enable comments const inlineCommentStartRe =