Highlights can now have links
This commit is contained in:
parent
7ad9b489cf
commit
9f137d70ef
2 changed files with 8 additions and 2 deletions
|
@ -127,6 +127,7 @@ function highlighter(json, full = true) {
|
|||
|
||||
var style = termProps.style || ""
|
||||
var classes = termProps.classes || ""
|
||||
var link = termProps.link || ""
|
||||
|
||||
if (termProps.color) {
|
||||
style += `color: ${termProps.color};`
|
||||
|
@ -155,7 +156,11 @@ function highlighter(json, full = true) {
|
|||
classes = `class="${classes}"`
|
||||
}
|
||||
|
||||
var replacement = `<span ${style} ${classes}>${startContent + highTable[index] + endContent}</span>`
|
||||
var replacement = `<span ${style} ${classes} ${link}>${startContent + highTable[index] + endContent}</span>`
|
||||
|
||||
if (link) {
|
||||
replacement = `<a href="${link}">${replacement}</a>`
|
||||
}
|
||||
|
||||
element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue