Update code/tests with latest functionality in Ruby markdownlint.

This commit is contained in:
David Anson 2016-09-24 16:15:54 -07:00
parent 2d8122a3be
commit fdeeddc99d
10 changed files with 57 additions and 7 deletions

View file

@ -781,6 +781,8 @@ module.exports = [
"tags": [ "headers", "emphasis" ],
"aliases": [ "no-emphasis-as-header" ],
"func": function MD036(params, errors) {
var punctuation = params.options.punctuation || ".,;:!?";
var re = new RegExp("[" + punctuation + "]$");
function base(token) {
if (token.type === "paragraph_open") {
return function inParagraph(t) {
@ -788,7 +790,8 @@ module.exports = [
(t.children.length === 3) &&
((t.children[0].type === "strong_open") ||
(t.children[0].type === "em_open")) &&
(t.children[1].type === "text")) {
(t.children[1].type === "text") &&
!re.test(t.children[1].content)) {
errors.push(t.lineNumber);
}
};