add bold red text 'title' markdown

merge-requests/208/head
fatchan 5 years ago
parent 9328efc496
commit 06d4b26e65
  1. 5
      gulp/res/css/style.css
  2. 8
      helpers/markdown.js

@ -140,6 +140,11 @@ object {
border-style: solid none; border-style: solid none;
} }
.title {
color: maroon;
font-weight: bold;
}
.redtext { .redtext {
color: maroon; color: maroon;
} }

@ -3,7 +3,8 @@
const Posts = require(__dirname+'/../db/posts.js') const Posts = require(__dirname+'/../db/posts.js')
, greentextRegex = /^>([^>].+)/gm , greentextRegex = /^>([^>].+)/gm
, redtextRegex = /^<([^<].+)/gm , redtextRegex = /^<([^<].+)/gm
, boldRegex = /==(.+)==/gm , boldRegex = /""(.+)""/gm
, titleRegex = /==(.+)==/gm
, italicRegex = /__(.+)__/gm , italicRegex = /__(.+)__/gm
, linkRegex = /https?\:\/\/[^\s]+/g , linkRegex = /https?\:\/\/[^\s]+/g
, spoilerRegex = /\|\|(.+)\|\|/gm , spoilerRegex = /\|\|(.+)\|\|/gm
@ -31,6 +32,11 @@ module.exports = (board, thread, text) => {
return `<strong>${bold}</strong>`; return `<strong>${bold}</strong>`;
}); });
//titles
text = text.replace(titleRegex, (match, title) => {
return `<span class='title'>${title}</span>`;
});
//italic //italic
text = text.replace(italicRegex, (match, italic) => { text = text.replace(italicRegex, (match, italic) => {
return `<em>${italic}</em>`; return `<em>${italic}</em>`;

Loading…
Cancel
Save