Added markdown

This commit is contained in:
CorwinDev committed 2022-08-18 16:19:43 +02:00
1 parent 93f2c8b0a8
commit 4a3bb5ae9b
10 files changed
+150 -49

No files matched your search

+1 -1
View File
@@ -92,7 +92,7 @@ router.get('/server/banner/:id', function (req, res) {
context.fillText(serverName, canvas.width / 2.7, canvas.height / 1.8);
context.font = '18px sans-serif';
context.fillText(`🙍‍♂️ ${serverMembers}`, canvas.width / 2.7, canvas.height / 1.1);
context.fillText(`😊 ${serverMembers}`, canvas.width / 2.7, canvas.height / 1.1);
context.fillText(`❤️ ${server.votes}`, canvas.width / 2.1, canvas.height / 1.1);
context.beginPath();
+3 -2
View File
@@ -89,7 +89,7 @@ router.get('/:botID', async function (req, res) {
return res.redirect('/');
}
if (bot.verified == false) {
if(!req.user) {
if (!req.user) {
req.backURL = req.originalUrl;
return res.redirect('/auth');
}
@@ -104,7 +104,8 @@ router.get('/:botID', async function (req, res) {
coowner.push(b)
})
var html = converter.makeHtml(bot.long_description);
html = sanitizeHtml(html)
html = sanitizeHtml(html,
{ allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']) })
res.render('bot/index', {
bot: bot,
user: req.user,
+8 -2
View File
@@ -6,7 +6,8 @@ var bots = require('../../../models/bot');
const client = require('../../../index');
const Discord = require('discord.js');
var showdown = require('showdown'),
converter = new showdown.Converter();
converter = new showdown.Converter()
const sanitizeHtml = require('sanitize-html');
function makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
@@ -160,10 +161,15 @@ router.get('/:server', async function (req, res) {
[`analytics.${referresURL}`]: 1
}
})
var html = converter.makeHtml(server.long_description);
console.log(html);
html = sanitizeHtml(html,
{ allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']) })
res.render('server/index', {
user: req.user,
server: server,
serverr: global.bsl.guilds.cache.get(server.id)
serverr: global.bsl.guilds.cache.get(server.id),
description: html,
});
})
})