mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-22 17:00:13 +01:00
Allow question mark by default for MD026/no-trailing-punctuation (fixes #276).
This commit is contained in:
parent
3827842930
commit
6c1bc8ecb5
8 changed files with 30 additions and 16 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addError, allPunctuation, escapeForRegExp, forEachHeading } =
|
||||
const { addError, allPunctuationNoQuestion, escapeForRegExp, forEachHeading } =
|
||||
require("../helpers");
|
||||
|
||||
module.exports = {
|
||||
|
|
@ -11,8 +11,9 @@ module.exports = {
|
|||
"tags": [ "headings", "headers" ],
|
||||
"function": function MD026(params, onError) {
|
||||
let punctuation = params.config.punctuation;
|
||||
punctuation =
|
||||
String((punctuation === undefined) ? allPunctuation : punctuation);
|
||||
punctuation = String(
|
||||
(punctuation === undefined) ? allPunctuationNoQuestion : punctuation
|
||||
);
|
||||
const trailingPunctuationRe =
|
||||
new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$");
|
||||
forEachHeading(params, (heading) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue