Add full-width punctuation characters to MD026/no-trailing-punctuation and MD036/no-emphasis-as-heading (fixes #192).

This commit is contained in:
David Anson 2019-06-06 22:21:31 -07:00
parent fa40084994
commit 1d8b9e7e62
8 changed files with 45 additions and 25 deletions

View file

@ -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") {