forked from MarseyWorld/MarseyWorld
Use single line breaks for markdown in comments (#177)
This fixes #144. Instead of double newlines (reddit spacing 🤮), this will allow single newlines to be used. Tested locally. Co-authored-by: vasya <vasya34@proton.me> Reviewed-on: rDrama/rDrama#177 Co-authored-by: vasya <vasya@noreply.fsdfsd.net> Co-committed-by: vasya <vasya@noreply.fsdfsd.net>master
parent
63f9d02abc
commit
7812bfb47d
|
@ -1,4 +1,5 @@
|
|||
marked.use({
|
||||
breaks: true,
|
||||
extensions: [
|
||||
{
|
||||
name: 'mention',
|
||||
|
@ -93,8 +94,6 @@ function markdown(t) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!input.includes('```') && !input.includes('<pre>'))
|
||||
input = input.replace(/\n/g, '\n\n')
|
||||
input = input.replace(/\|\|(.*?)\|\|/g, '<spoiler>$1</spoiler>')
|
||||
input = input.replace(/(\n|^)>([^ >][^\n]*)/g, '$1<g>\>$2</g>')
|
||||
input = input.replace(/((\s|^)[0-9]+)\. /g, '$1\\. ')
|
||||
|
|
Loading…
Reference in New Issue