Skip to content

Fenced code blocks should use "language-*" classes #2675

@apfelbox

Description

@apfelbox

Hi,

currently fenced code blocks just translate the language (if given) directly into the class:

```javascript
content
```

produces:

<pre><code class="javascript">content</code></pre>

According to the HMTL5 spec, the recommended way to markup code with a "language-" prefixed class:

<pre><code class="language-javascript">content</code></pre>

I think Ghost should follow the spec here.

Metadata

Metadata

Assignees

Labels

affects:editorWork relating to the Koenig Editorbug[triage] something behaving unexpectedly

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions