🎉 Feat: add more type marked text support

This commit is contained in:
Cell
2024-11-04 12:48:59 +08:00
parent 41014f7f5b
commit 712cf2a868
3 changed files with 25 additions and 1 deletions
+14
View File
@@ -289,6 +289,20 @@
}
}
mark {
padding: 0.14em 0.28em;
background-color: var(--#{$prefix}mark-background-color, mark);
color: var(--#{$prefix}mark-color, marktext);
@include border-radius($global-border-radius);
@each $color, $value in $theme-colors {
&.mark-#{$color} {
--#{$prefix}mark-color: #fff;
--#{$prefix}mark-background-color: var(--#{$prefix}#{$color});
}
}
}
.table-wrapper {
overflow-x: auto;
--#{$prefix}scrollbar-thumb-color: #{$table-background-color};
+1 -1
View File
@@ -15,7 +15,7 @@
{{- end -}}
{{- $content = partial "function/task-lists.html" $content -}}
{{- $content = partial "function/marked-text.html" $content -}}
{{- $content = partial "function/escape.html" $content -}}
{{- end -}}
@@ -0,0 +1,10 @@
{{- /*
Marked texts rendering
This is an experimental syntax highlighting for the marked texts.
Embed types: default, primary, secondary, success, warning, danger
*/ -}}
{{- $content := replaceRE `<mark>(.+?)</mark>\[(.+?)\]` `<mark class="mark-$2">$1</mark>` . -}}
{{- $content = replaceRE `<mark>(.+?)</mark>` `<mark class="mark-default">$1</mark>` $content -}}
{{- return $content -}}