Bolding and Italics on highlights
This commit is contained in:
parent
10e4a95c7c
commit
b2f13c600f
3 changed files with 20 additions and 2 deletions
|
@ -168,6 +168,11 @@
|
|||
"Teto": {
|
||||
"color": "rgb(255, 100, 100)",
|
||||
"caseInsensitive": true
|
||||
},
|
||||
"Ryouiki Tenkai": {
|
||||
"bold": true,
|
||||
"italicized": true,
|
||||
"caseInsensitive": true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -175,16 +175,29 @@ function converter(html) {
|
|||
var startContent = element.content.substring(spanStart - 1, termIndex)
|
||||
|
||||
var style = termProps.style || ""
|
||||
var classes = termProps.classes || ""
|
||||
|
||||
if (termProps.color) {
|
||||
style += `color: ${termProps.color};`
|
||||
}
|
||||
|
||||
if (termProps.italicized) {
|
||||
style += "font-style: italic;"
|
||||
}
|
||||
|
||||
if (termProps.bold) {
|
||||
classes += "bold"
|
||||
}
|
||||
|
||||
if (style.length > 2) {
|
||||
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)
|
||||
}
|
||||
|
|
|
@ -328,7 +328,7 @@ em, b, s {
|
|||
color: inherit;
|
||||
}
|
||||
|
||||
b, b > *, .activityTitle, .activityTitle > * {
|
||||
b, b > *, .activityTitle, .activityTitle > *, .bold {
|
||||
font-family: "RubikBold", Verdana, Geneva, Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue