#195 - Fixed issue where $1 & $2 were shown as-is in case of no content to replace
This commit is contained in:
@@ -26,7 +26,11 @@ export function highlighter(str: string): string {
|
|||||||
return `<span class="${highlightClass}">${str}</span>`
|
return `<span class="${highlightClass}">${str}</span>`
|
||||||
}
|
}
|
||||||
|
|
||||||
export const highlighterGroups = `$1<span class="${highlightClass}">$2</span>`
|
export function highlighterGroups(...args: any[]) {
|
||||||
|
if (args[1] && args[2])
|
||||||
|
return `${args[1]}<span class="${highlightClass}">${args[2]}</span>`
|
||||||
|
return '<no content>'
|
||||||
|
}
|
||||||
|
|
||||||
export function escapeHTML(html: string): string {
|
export function escapeHTML(html: string): string {
|
||||||
return html
|
return html
|
||||||
|
|||||||
Reference in New Issue
Block a user