mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
added mdash transform
This commit is contained in:
parent
677dce9721
commit
4da04bb970
1 changed files with 5 additions and 1 deletions
|
@ -95,7 +95,10 @@ export const formatText = (text: string): string =>
|
||||||
.replace(/:\/\//gim, ':|--|')
|
.replace(/:\/\//gim, ':|--|')
|
||||||
.replace(/(\/\/[^\n]+)/gim, '<span class="grey">$1</span>')
|
.replace(/(\/\/[^\n]+)/gim, '<span class="grey">$1</span>')
|
||||||
.replace(/\/\/\s*(todo|туду):?\s*([^\n]+)/gim, '// <span class="todo">$1</span> $2')
|
.replace(/\/\/\s*(todo|туду):?\s*([^\n]+)/gim, '// <span class="todo">$1</span> $2')
|
||||||
.replace(/\/\/\s*(done|сделано|сделал|готово|fixed|пофикшено|фиксед):?\s*([^\n]+)/gim, '// <span class="done">$1</span> $2')
|
.replace(
|
||||||
|
/\/\/\s*(done|сделано|сделал|готово|fixed|пофикшено|фиксед):?\s*([^\n]+)/gim,
|
||||||
|
'// <span class="done">$1</span> $2'
|
||||||
|
)
|
||||||
.replace(/(\*\*[\s\S]*?\*\*)/gim, '<b class="bold white">$1</b>')
|
.replace(/(\*\*[\s\S]*?\*\*)/gim, '<b class="bold white">$1</b>')
|
||||||
.replace(/(\_\_[\s\S]*?\_\_)/gim, '<i>$1</i>')
|
.replace(/(\_\_[\s\S]*?\_\_)/gim, '<i>$1</i>')
|
||||||
.replace(/(\!\![\s\S]*?(\!\!|\n|$))/gim, '<span class="green">$1</span>')
|
.replace(/(\!\![\s\S]*?(\!\!|\n|$))/gim, '<span class="green">$1</span>')
|
||||||
|
@ -106,6 +109,7 @@ export const formatText = (text: string): string =>
|
||||||
/(\b(https?|ftp|file):\/\/([-A-Z0-9+&@#%?=~_|!:,.;]*)([-A-Z0-9+&@#%?\/=~_|!:,.;]*)[-A-Z0-9+&@#\/%=~_|])/gi,
|
/(\b(https?|ftp|file):\/\/([-A-Z0-9+&@#%?=~_|!:,.;]*)([-A-Z0-9+&@#%?\/=~_|!:,.;]*)[-A-Z0-9+&@#\/%=~_|])/gi,
|
||||||
'<a href="$1" target="blank" rel="nofollow">$1</a>'
|
'<a href="$1" target="blank" rel="nofollow">$1</a>'
|
||||||
)
|
)
|
||||||
|
.replace(' -- ', ' — ')
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter(el => el.trim().length)
|
.filter(el => el.trim().length)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue