diff --git a/posts.json b/posts.json index 430d78c..c832528 100644 --- a/posts.json +++ b/posts.json @@ -1,7 +1,7 @@ [ { "title": "Default post", - "content": "This is the first post, it was here since the beginning.\n\n\n(Remove the space after the '[' and before the ']')\n\n [ * [* text *] * ] [ ** [** text **] ** ] [ *** [*** text ***] *** ] [ _ [_ text _] _ ] [ *_ [*_ text _*] _* ] [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** ] [ \" [\" text \"] \" ]", + "content": "This is the first post, it was here since the beginning.\n\n\n(Remove the space after the '[' and before the ']')\n\n [ * [* text *] * ] [ ** [** text **] ** ] [ *** [*** text ***] *** ] [ _ [_ text _] _ ] [ *_ [*_ text _*] _* ] [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** ] [ \" [\" text \"] \" ]", "author": "root", "comments": [ { diff --git a/views/post.ejs b/views/post.ejs index 8ccdbe1..37658da 100644 --- a/views/post.ejs +++ b/views/post.ejs @@ -106,17 +106,16 @@ ret += `
${date ? (`
${date.toUTCString()}
`) : ''}

${post.author.replaceAll('<','<').replaceAll('>','>')}: ${post.title.replaceAll('<','<').replaceAll('>','>')}

` + post.content.replaceAll('<','<').replaceAll('>','>') - .replaceAll('[* ', '').replaceAll(' *]', '') .replaceAll(/(https?:\/\/[^ \n]+)/g, '$1') - .replaceAll('[** ', '').replaceAll(' **]', '') - .replaceAll('[*** ', '').replaceAll(' ***]', '') - .replaceAll('[_ ', '').replaceAll(' _]', '') - .replaceAll('[*_ ', '').replaceAll(' _*]', '') - .replaceAll('[**_ ', '').replaceAll(' _**]', '') - .replaceAll('[***_ ', '').replaceAll(' _***]', '') - .replaceAll('[" ', '
').replaceAll(' "]', '
') - .replaceAll('["\n', '
').replaceAll('\n"]', '
') - .replaceAll('["" \n', '
').replaceAll('\n ""]', '
') + .replaceAll(/\[[*] ([\w\W]*) [*]\]/g, '$1') + .replaceAll(/\[[*][*] ([\w\W]*) [*][*]\]/g, '$1') + .replaceAll(/\[[*][*][*] ([\w\W]*) [*][*][*]\]/g, '$1') + .replaceAll(/\[[_] ([\w\W]*) [_]\]/g, '$1') + .replaceAll(/\[[*][_] ([\w\W]*) [_][*]\]/g, '$1') + .replaceAll(/\[[*][*][_] ([\w\W]*) [_][*][*]\]/g, '$1') + .replaceAll(/\[[*][*][*][_] ([\w\W]*) [_][*][*][*]\]/g, '$1') + .replaceAll(/\[["] ([\w\W]*) ["]\]/g, '
$1
') + .replaceAll(/\[["]["]* \n([\w\W]*)\n ["]["]*\]/g, '
$1
') .replaceAll('\n', '
') ret += '
' if (postid != -1 || id == '') {