Disable a bunch of markdown rules
Most were unused, there were a times where "..." was being transformed to a single ellipse character. And I used strikethrough once, but that's dumb
This commit is contained in:
parent
fe01d3913f
commit
0583ee40f0
|
@ -112,11 +112,16 @@
|
||||||
}
|
}
|
||||||
}).use(remarkable.linkify);
|
}).use(remarkable.linkify);
|
||||||
|
|
||||||
// Allow data: URIs for images, from https://github.com/jonschlinkert/remarkable/issues/329
|
// I'm leaving in "references", which handles the convention of putting your links at the bottom of your post
|
||||||
const originalLinkValidator = md.inline.validateLink;
|
md.core.ruler.disable(["abbr", "abbr2", "footnote_tail", "replacements"]);
|
||||||
const dataLinkRegex = /^\s*data:([a-z]+\/[a-z]+(;[a-z-]+=[a-z-]+)?)?(;base64)?,[a-z0-9!$&'',()*+,;=\-._~:@/?%\s]*\s*$/i;
|
md.block.ruler.disable(["hr", "footnote", "heading", "lheading", "table", "htmlblock"]);
|
||||||
|
md.inline.ruler.disable(["del", "ins", "mark", "sub", "sup", "footnote_inline", "footnote_ref", "htmltag", "entity", "autolink"]);
|
||||||
|
|
||||||
md.inline.validateLink = (url) => originalLinkValidator(url) || url.match(dataLinkRegex);
|
//Images are parsed as inline links, so we can't turn off parsing,
|
||||||
|
//but we can overwrite the renderer so they never get displayed. Not ideal
|
||||||
|
/*md.renderer.rules.image = function () {
|
||||||
|
return "";
|
||||||
|
};*/
|
||||||
|
|
||||||
for (let el of els) {
|
for (let el of els) {
|
||||||
const extendedText = el.querySelector(".extended-text");
|
const extendedText = el.querySelector(".extended-text");
|
||||||
|
|
Loading…
Reference in New Issue