1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 21:06:42 +07:00

highlight multiline comments

This commit is contained in:
Fedor Katurov 2019-11-07 16:14:37 +07:00
parent f0acb1ee66
commit c1825a1b1c

View file

@ -81,6 +81,7 @@ export const formatText = (text: string): string =>
.replace(/>/g, '>')
.replace(/:\/\//gim, ':|--|')
.replace(/(\/\/[^\n]+)/gim, '<span class="grey">$1</span>')
.replace(/(\/\*[\s\S]*?\*\/)/gim, '<span class="grey">$1</span>')
.replace(/:\|--\|/gim, '://')
.split('\n')
.map(el => `<p>${el}</p>`)