aboutsummaryrefslogtreecommitdiffstats
path: root/server.js
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-04-09 14:35:41 +0000
committerterminaldweller <thabogre@gmail.com>2021-04-09 14:35:41 +0000
commit8e38d9382b0d588a80441e7c7650a58b11ba4564 (patch)
tree0b217ad27777f4d8f7d1098125352e610775c7e8 /server.js
parenta simple node express ejs blog (diff)
downloadblog-8e38d9382b0d588a80441e7c7650a58b11ba4564.tar.gz
blog-8e38d9382b0d588a80441e7c7650a58b11ba4564.zip
trying to add syntax highlighting for markdown
Diffstat (limited to 'server.js')
-rwxr-xr-xserver.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/server.js b/server.js
index eaf1ac5..ca73018 100755
--- a/server.js
+++ b/server.js
@@ -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));
});
});