When converting Markdown to HTML using --no-highlight option with fenced_code_attributes flag enabled, then <pre class="name"><code> tags are generated.
This request is to update <pre class="name"><code> to generate W3C HTML5 recommendation example output syntax <pre><code class="language-name">.
For example, <pre class="markdown"><code> would become HTML5 <pre><code class="language-markdown">.
W3C HTML5 Recommendation: code element
Authors who wish to mark code elements with the language used, e.g. so that syntax highlighting scripts can use the right rules, can use the class attribute, e.g. by adding a class prefixed with "language-" to the element.
Code Example:
The following example shows how a block of code could be marked up using the pre and code elements.
<pre><code class="language-pascal">var i: Integer;
begin
i := 1;
end.</code></pre>
Prism.js Basic Useage also illustrates use the same HTML5 recommendation example syntax
Therefore, it only works with <code> elements, since marking up code without a <code> element is semantically invalid. According to the HTML5 spec, the recommended way to define a code language is a language-xxxx class, which is what Prism uses.
When converting Markdown to HTML using
--no-highlightoption withfenced_code_attributesflag enabled, then <pre class="name"><code> tags are generated.This request is to update <pre class="name"><code> to generate W3C HTML5 recommendation example output syntax <pre><code class="language-name">.
For example, <pre class="markdown"><code> would become HTML5 <pre><code class="language-markdown">.
W3C HTML5 Recommendation:
codeelementPrism.js Basic Useage also illustrates use the same HTML5 recommendation example syntax