Much more modular "Style" system will allow for more freedom of highlighting effects
This commit is contained in:
parent
1abe39258f
commit
3cc2844e1c
2 changed files with 11 additions and 2 deletions
|
@ -164,6 +164,9 @@
|
|||
"Teto Territory": {
|
||||
"color": "rgb(255, 100, 100)",
|
||||
"caseInsensitive": true
|
||||
},
|
||||
"Services": {
|
||||
|
||||
},
|
||||
"Teto": {
|
||||
"color": "rgb(255, 100, 100)",
|
||||
|
|
|
@ -174,7 +174,13 @@ function converter(html) {
|
|||
var spanStart = element.content.substring(0, termIndex).lastIndexOf(" ")
|
||||
var startContent = element.content.substring(spanStart, termIndex)
|
||||
|
||||
var replacement = `<span style="color: ${termProps.color}">${startContent + highTable[index] + endContent}</span>`
|
||||
var style = ""
|
||||
|
||||
if (termProps.color) {
|
||||
style += `color: ${termProps.color};`
|
||||
}
|
||||
|
||||
var replacement = `<span style="${style}">${startContent + highTable[index] + endContent}</span>`
|
||||
|
||||
element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue