HTML Shortcode getting escaped when used in a code block

Hi,

I have created a shortcode like <mark> {{ .Inner }} </mark> to highlight specific words on my website. It works in text areas of the website however it does not work when I use it within a source code block because the < > characters of the tags are escaped.

An example of how I am trying to use it:
{{< highlight python >}} {{< mark >}}test{{< /mark >}} {{< /highlight >}}

Which results in the following on the website:
<code class="language-python" data-lang="python"><span style="display:flex; background-color:#191919"><span>&lt;mark&gt; test &lt;/mark&gt;</span>

The main reason for me creating this short code was to highlight words in source code blocks. So any help I can get on how to stop this escaping from happening would be really appreciated!

Thanks :slight_smile:

This is not possible.

The inner shortcode renders the mark element (<mark>test</mark>), and the outer shortcode highlights the HTML.

You can highlight one or more lines with the hl_lines argument, but you cannot highlight individual words.