Bolding and Italics on highlights

This commit is contained in:
bingus_violet 2024-06-18 07:34:57 -05:00
parent 10e4a95c7c
commit b2f13c600f
3 changed files with 20 additions and 2 deletions

View file

@ -168,6 +168,11 @@
"Teto": { "Teto": {
"color": "rgb(255, 100, 100)", "color": "rgb(255, 100, 100)",
"caseInsensitive": true "caseInsensitive": true
},
"Ryouiki Tenkai": {
"bold": true,
"italicized": true,
"caseInsensitive": true
} }
} }
} }

View file

@ -175,16 +175,29 @@ function converter(html) {
var startContent = element.content.substring(spanStart - 1, termIndex) var startContent = element.content.substring(spanStart - 1, termIndex)
var style = termProps.style || "" var style = termProps.style || ""
var classes = termProps.classes || ""
if (termProps.color) { if (termProps.color) {
style += `color: ${termProps.color};` style += `color: ${termProps.color};`
} }
if (termProps.italicized) {
style += "font-style: italic;"
}
if (termProps.bold) {
classes += "bold"
}
if (style.length > 2) { if (style.length > 2) {
style = `style="${style}"` style = `style="${style}"`
} }
var replacement = `<span ${style}>${startContent + highTable[index] + endContent}</span>` if (classes.length > 2) {
classes = `class="${classes}"`
}
var replacement = `<span ${style} ${classes}>${startContent + highTable[index] + endContent}</span>`
element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd) element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd)
} }

View file

@ -328,7 +328,7 @@ em, b, s {
color: inherit; color: inherit;
} }
b, b > *, .activityTitle, .activityTitle > * { b, b > *, .activityTitle, .activityTitle > *, .bold {
font-family: "RubikBold", Verdana, Geneva, Tahoma, sans-serif; font-family: "RubikBold", Verdana, Geneva, Tahoma, sans-serif;
} }