Merge remote-tracking branch 'refs/remotes/origin/master'
This commit is contained in:
commit
0660b1c05c
2 changed files with 11 additions and 2 deletions
|
@ -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 \"] \" ]",
|
||||
"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 \"] \" ] [ # image link # ]",
|
||||
"author": "root",
|
||||
"comments": [
|
||||
{
|
||||
|
|
|
@ -91,6 +91,14 @@
|
|||
block {
|
||||
display: block;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
margin: auto;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
max-width: 90%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -108,7 +116,8 @@
|
|||
ret +=
|
||||
`<post><div class="content">${date ? (`<h6>${date.toUTCString()}</h6>`) : ''}<h3>${post.author.replaceAll('<','<').replaceAll('>','>')}: ${post.title.replaceAll('<','<').replaceAll('>','>')}</h3>` +
|
||||
post.content.replaceAll('<','<').replaceAll('>','>')
|
||||
.replaceAll(/(https?:\/\/[^ \n]+)/g, '<a href="$1" target="_blank">$1</a>')
|
||||
.replaceAll(/\[[#] ([^"]*?) [#]\]/g, '<img src="$1">')
|
||||
.replaceAll(/(?<!")(https?:\/\/[^ \n]+)(?!")/g, '<a href="$1" target="_blank">$1</a>')
|
||||
.replaceAll(/\[[*] ([\w\W]*?) [*]\]/g, '<i>$1</i>')
|
||||
.replaceAll(/\[[*][*] ([\w\W]*?) [*][*]\]/g, '<b>$1</b>')
|
||||
.replaceAll(/\[[*][*][*] ([\w\W]*?) [*][*][*]\]/g, '<b><i>$1</i></b>')
|
||||
|
|
Loading…
Add table
Reference in a new issue