Skip to content

Do not syntax highlight <pre> blocks with multiple <code> tags

What does this MR do and why?

Trying to syntax highlight <pre> blocks with multiple <code> nodes will fail. Such as

<pre><code>something</code> and <code>another</code></pre>

This is not a valid block to syntax highlight anyway, and should be ignored.

How to set up and validate locally

Paste the following in a comment box, and preview it. It should display properly rather than generating and error or always showing "Loading"

<pre><code>something</code> and <code>another</code></pre>

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #349760 (closed)

Edited by Brett Walker

Merge request reports