diff --git a/tdx-enhanced.js b/tdx-enhanced.js index ca10fe2..8ae7daf 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -686,6 +686,7 @@ } function handleHighlight(type, txt, element) { + let behavior = settings('get','highlightBehavior') var re var style = null @@ -745,11 +746,19 @@ //console.log("Apply custom highlight:",txt) let link = element.querySelector("a") - if (re && link) { - let newTitle = re[1] - link.innerText = newTitle - //reset regex - re.lastIndex = 0 + if (behavior==="block") { + if (re && link) { + let newTitle = re[1] + link.innerText = newTitle + //reset regex + re.lastIndex = 0 + } + } else { + if (re && link) { + element = link + //reset regex + re.lastIndex = 0 + } } for (const [attr,val] of Object.entries(style)) { @@ -1060,6 +1069,13 @@ +