diff --git a/index.html b/index.html index 3c4a172..82f9da2 100644 --- a/index.html +++ b/index.html @@ -27,11 +27,7 @@ - - - - diff --git a/node/blog.js b/node/blog.js index 315b609..6b0c69a 100644 --- a/node/blog.js +++ b/node/blog.js @@ -4,8 +4,8 @@ const { const fs = require("fs"); const showdown = require("showdown"); -require("../shared/showdown-prettify"); -require("../shared/showdown-footnotes"); +require("./showdown-prettify"); +require("./showdown-footnotes"); const converter = new showdown.Converter({ parseImgDimensions: true, headerLevelStart: 3, diff --git a/node/rss.js b/node/rss.js index ccfc516..fcc9337 100644 --- a/node/rss.js +++ b/node/rss.js @@ -4,8 +4,8 @@ const { const fs = require("fs"); const showdown = require("showdown"); -require("../shared/showdown-prettify"); -require("../shared/showdown-footnotes"); +require("./showdown-prettify"); +require("./showdown-footnotes"); const converter = new showdown.Converter({ parseImgDimensions: true, extensions: ["prettify", "footnotes"] diff --git a/shared/showdown-footnotes.js b/node/showdown-footnotes.js similarity index 86% rename from shared/showdown-footnotes.js rename to node/showdown-footnotes.js index b699c99..520ea8f 100644 --- a/shared/showdown-footnotes.js +++ b/node/showdown-footnotes.js @@ -20,7 +20,7 @@ return [{ type: 'lang', filter: function filter(text) { - return text.replace(/^\[\^([\d\w]+)\]:\s*((\n+(\s{2,4}|\t).+)+)$/mg, function (str, name, rawContent, _, padding) { + return text.replace(/^\[\^([\d\w]+)\]:\s*((\n+(\s{2,4}|\t).+)+)$/mgi, function (str, name, rawContent, _, padding) { var content = converter.makeHtml(rawContent.replace(new RegExp('^' + padding, 'gm'), '')); return '
[' + name + ']:' + content + '
'; }); @@ -28,14 +28,14 @@ }, { type: 'lang', filter: function filter(text) { - return text.replace(/^\[\^([\d\w]+)\]:( |\n)((.+\n)*.+)$/mg, function (str, name, _, content) { + return text.replace(/^\[\^([\d\w]+)\]:( |\n)((.+\n)*.+)$/mgi, function (str, name, _, content) { return '[' + name + ']: ' + content + ''; }); } }, { type: 'lang', filter: function filter(text) { - return text.replace(/\[\^([\d\w]+)\]/m, function (str, name) { + return text.replace(/\[\^([\d\w]+)\]/mgi, function (str, name) { return '[' + name + ']'; }); } diff --git a/shared/showdown-prettify.js b/node/showdown-prettify.js similarity index 100% rename from shared/showdown-prettify.js rename to node/showdown-prettify.js diff --git a/scripts/blog.js b/scripts/blog.js index 7c2316e..89ed0bd 100644 --- a/scripts/blog.js +++ b/scripts/blog.js @@ -1,8 +1,3 @@ -let converter = new showdown.Converter({ - parseImgDimensions: true, - headerLevelStart: 3, - extensions: ["prettify", "footnotes"] -}); $.ajax({ dataType: "json", url: "blog/posts.json",