Language hint in the code block


#1

In the new editor I found how to add the code block (type ```). What I would like to add is language hint. I’m using syntax highlight library that does it for me and it relies on the hint.

The workaround now is to use markup block and use ```js in it. Just wonder if there is a correct way that I’ve missed in the editor or using markup is the only option to add the language hint?

Kind Regards,
Alex


#2

I don’t think so.


#3

Are you referring to this? Sorry, I myself do not understand what you’re trying to achieve.


#4

I don’t think this a feature at the moment. Try requesting it?


#5

In the markdown ``` (three backticks) defines a code block.

```
this is a code block
```

A word typed after the opening triplet goes to class attribute of the generated <pre> tag just like this:

```js
// some javascript here
```

becomes

<pre class="language-js">
// some javascript here
</pre>

In the new Ghost editor you can create a code block by typing three backticks. But I cannot see a way to add language hint. So the question is whether the way exists or it does not?


#6

It’s all right. I’m only interested whether I’ve overlooked it or not.


#7

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.