render markdown

This commit is contained in:
Ashley Graves 2024-10-15 15:14:59 +02:00
parent bfb14f4b15
commit c4daa7886d
3 changed files with 23 additions and 1 deletions

View file

@ -20,6 +20,7 @@
"groq-sdk": "^0.7.0",
"html-entities": "^2.5.2",
"knex": "^3.1.0",
"pagination.djs": "^4.0.16"
"pagination.djs": "^4.0.16",
"showdown": "^2.1.0"
}
}

View file

@ -47,6 +47,9 @@ importers:
pagination.djs:
specifier: ^4.0.16
version: 4.0.16(discord.js@14.16.3)
showdown:
specifier: ^2.1.0
version: 2.1.0
packages:
@ -245,6 +248,10 @@ packages:
resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==}
engines: {node: '>=14'}
commander@9.5.0:
resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
engines: {node: ^12.20.0 || >=14}
concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
@ -814,6 +821,10 @@ packages:
setprototypeof@1.2.0:
resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
showdown@2.1.0:
resolution: {integrity: sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==}
hasBin: true
side-channel@1.0.6:
resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
engines: {node: '>= 0.4'}
@ -1203,6 +1214,8 @@ snapshots:
commander@10.0.1: {}
commander@9.5.0: {}
concat-map@0.0.1: {}
console-control-strings@1.1.0: {}
@ -1773,6 +1786,10 @@ snapshots:
setprototypeof@1.2.0: {}
showdown@2.1.0:
dependencies:
commander: 9.5.0
side-channel@1.0.6:
dependencies:
call-bind: 1.0.7

View file

@ -2,6 +2,7 @@ const { join, resolve } = require("node:path");
const { Client } = require("discord.js");
const { knex: db } = require("../db.js");
const express = require("express");
const { Converter } = require("showdown");
const app = express();
app.set("view engine", "ejs");
@ -28,6 +29,9 @@ app.get("/view/:paste", async function (req, res) {
return;
}
var converter = new Converter();
paste = converter.makeHtml(paste);
res.render("view", {
bot,
paste