I would like to customize an existing highlightjs language definition,
so some character sequences (based on a regex) become clickable.
The usage scenario is code example in a documentation, where some expressions can be links leading to another documentation page.
Reading the documentation, I understand that I should extend existing language definition in order to add a custom scope, or perhaps Markups, but don't know how.
(Disclaimer: Never played with JavaScript before)
Minimalistic example:
Code
static_assert(csl::ag::size<A>::value == 2);
// ^^^^^^^^^^^^^^^^ goal : this expression as a link
Current behavior :
<code class="hljs language-cpp">
<span class="hljs-built_in">static_assert</span>
(csl::ag::size<A>::value ==
<span class="hljs-number">2</span>);
</code>
Expected behavior:
<code class="hljs language-cpp">
<span class="hljs-built_in">static_assert</span>
(
<span class="hljs-some_custom_name_here">csl::ag::size<A></span>
::value ==
<span class="hljs-number">2</span>);
</code>
Where <span class="hljs-some_custom_name_here">csl::ag::size<A></span> will then become clickable with extra code.