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

hightlighting todos

This commit is contained in:
Fedor Katurov 2020-07-23 11:08:37 +07:00
parent 0962dbc7fb
commit 3cb10177f7
2 changed files with 22 additions and 0 deletions

View file

@ -49,9 +49,11 @@ body {
&:global(.double) {
height: $spc * 2;
}
&:global(.quadro) {
height: $spc * 4;
}
&:global(.sixty) {
height: $spc * 6;
}
@ -83,6 +85,24 @@ body {
color: #555555;
}
:global {
.todo, .done {
color: #333333;
border-radius: 3px;
padding: 0 2px;
font: $font_14_semibold;
text-transform: uppercase;
}
.todo {
background-color: $red;
}
.done {
background-color: $green;
}
}
:global(h2) {
font: $font_24_bold;
}

View file

@ -94,6 +94,8 @@ export const formatText = (text: string): string =>
)
.replace(/:\/\//gim, ':|--|')
.replace(/(\/\/[^\n]+)/gim, '<span class="grey">$1</span>')
.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\S]*?\*\*)/gim, '<b class="bold white">$1</b>')
.replace(/(\_\_[\s\S]*?\_\_)/gim, '<i>$1</i>')
.replace(/(\!\![\s\S]*?(\!\!|\n|$))/gim, '<span class="green">$1</span>')