diff options
author | terminaldweller <thabogre@gmail.com> | 2021-04-09 14:35:41 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2021-04-09 14:35:41 +0000 |
commit | 8e38d9382b0d588a80441e7c7650a58b11ba4564 (patch) | |
tree | 0b217ad27777f4d8f7d1098125352e610775c7e8 /server.js | |
parent | a simple node express ejs blog (diff) | |
download | blog-8e38d9382b0d588a80441e7c7650a58b11ba4564.tar.gz blog-8e38d9382b0d588a80441e7c7650a58b11ba4564.zip |
trying to add syntax highlighting for markdown
Diffstat (limited to 'server.js')
-rwxr-xr-x | server.js | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -4,19 +4,22 @@ const express = require("express"); const path = require("path"); const fs = require("fs"); -const mitTexMath = require("markdown-it-texmath"); -const mitMulMd = require("markdown-it-multimd-table"); const mit = require("markdown-it")({ html: true }) .enable(["table"]) .disable(["strikethrough"]) - .use(mitTexMath, { + .use(require("markdown-it-texmath"), { engine: require("katex"), delimiters: "gitlab", katexOptions: { macros: { "\\RR": "\\mathbb{R}" } }, }) - .use(mitMulMd); -const app = express(); + .use(require("markdown-it-multimd-table")) + .use(require("markdown-it-highlightjs"), { + inline: true, + auto: true, + code: true, + }); +const app = express(); app.use(express.static("./")); app.use(express.static(path.join(__dirname, "css"))); app.set("views", "./views"); @@ -33,6 +36,7 @@ app.get("/", (req, res) => { mds: ["c struct to lua table", "lazy makefiles", "telegram lua"], }, }); + console.log(mit.render(chunk)); }); }); |