mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-22 00:40:12 +01:00
Add full-width punctuation characters to MD026/no-trailing-punctuation and MD036/no-emphasis-as-heading (fixes #192).
This commit is contained in:
parent
fa40084994
commit
1d8b9e7e62
8 changed files with 45 additions and 25 deletions
|
|
@ -2,14 +2,15 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addError, forEachHeading, rangeFromRegExp } = require("../helpers");
|
||||
const { addError, allPunctuation, forEachHeading, rangeFromRegExp } =
|
||||
require("../helpers");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD026", "no-trailing-punctuation" ],
|
||||
"description": "Trailing punctuation in heading",
|
||||
"tags": [ "headings", "headers" ],
|
||||
"function": function MD026(params, onError) {
|
||||
const punctuation = params.config.punctuation || ".,;:!?";
|
||||
const punctuation = params.config.punctuation || allPunctuation;
|
||||
const trailingPunctuationRe = new RegExp("[" + punctuation + "]$");
|
||||
forEachHeading(params, function forHeading(heading, content) {
|
||||
const match = trailingPunctuationRe.exec(content);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue