doc: all <pre> tags are highlighted as JavaScript

📗 API Reference Docs Problem

  • Version: n/a
  • Platform: n/a
  • Subsystem: n/a

Location

Section of the site where the content exists

Affected URL(s):

Problem description

Concise explanation of what you found to be problematic

While looking into #32938, I discovered that currently, every single <pre> tag gets highlighted as JavaScript regardless of the info string specified (and even if left unspecified). The following line executes the code that does this.

<script>highlight(undefined, undefined, 'pre');</script>

This behavior can be observed in the C++ code blocks in the published API reference documents. The following line is the reason for this — the language has been hard-coded.

sh_highlightElement(element, sh_languages["javascript"]);

  • I would like to work on this issue and submit a pull request.

^ I'm currently on summer vacation, so I would have the time to work on this.

/cc @Trott