From cbb4cbcd7e060ff233b02e5a33e4c283e2cbb559 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Fri, 3 Feb 2023 12:37:28 +0100 Subject: [PATCH] syntax highlightning example on jxr --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.html b/index.html index 547167f..704e1a4 100644 --- a/index.html +++ b/index.html @@ -2316,6 +2316,12 @@ consider pick then apply, i.e changeColorLastId() but for next Id */ +jxrhighlight(){ + [...document.querySelectorAll("[value]")] + .filter( el => (el.getAttribute("value").match(/^jxr /))) + .map( el => el.setAttribute("troika-text", {colorRanges: {0: 0x0099ff, 3: 0xffffff}}) ) + // see also generalization via https://shiki.matsu.io custom renderers +}