|
|
@ -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>`; |
|
|
|