Highlights can now have links
This commit is contained in:
parent
7ad9b489cf
commit
9f137d70ef
2 changed files with 8 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
|||
"World's Worst Developer",
|
||||
"The worst git user to exist",
|
||||
"These birds are Pissing me off... I'm the original Starwalker",
|
||||
"Make sure to check out <a href='https://univerter.dev'>Univerter!</a>",
|
||||
"Make sure to check out Univerter!",
|
||||
"Check out <a href='https://asahixp.pages.gay'>Asahi's website! <3</a>",
|
||||
"Check out <a href='https://sylvie.loveh.art/'>Sylvie's website! <3</a>"
|
||||
],
|
||||
|
@ -185,6 +185,7 @@
|
|||
"color": "lightgray"
|
||||
},
|
||||
"Univerter": {
|
||||
"link": "https://univerter.dev/",
|
||||
"color": "rgb(200, 175, 255)"
|
||||
},
|
||||
"Ko-fi": {
|
||||
|
|
|
@ -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…
Reference in a new issue