manuel-serrano / hop

Multitier JavaScript
Other
142 stars 18 forks source link

Feature-request: `language-xxxx` class added to labelled, fenced, markdown code blocks #78

Closed vidjuheffex closed 4 years ago

vidjuheffex commented 4 years ago

Here's the html5 recommended spec on pre/code blocks: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-code-element

In markdown, labeling the fenced code blocks with the language name, i.e. having:

```javascript
function(){}

in most libraries becomes: <pre><code class="language-javascript"></code></pre>

This in turn allows easier syntax highlighting with libraries like prism.js and others.

manuel-serrano commented 4 years ago

Hi Julian,

Thanks for the suggestion and the reference. The last version generates something similar but it lacks the "language-" prefix. I will add it right away.

-- Manuel