mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +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,14 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addErrorContext } = require("../helpers");
|
||||
const { addErrorContext, allPunctuation } = require("../helpers");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ],
|
||||
"description": "Emphasis used instead of a heading",
|
||||
"tags": [ "headings", "headers", "emphasis" ],
|
||||
"function": function MD036(params, onError) {
|
||||
const punctuation = params.config.punctuation || ".,;:!?";
|
||||
const punctuation = params.config.punctuation || allPunctuation;
|
||||
const re = new RegExp("[" + punctuation + "]$");
|
||||
function base(token) {
|
||||
if (token.type === "paragraph_open") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue