Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
130 views
in Plugins by

How can I specify the language for a code block in markdown-editor?

Fenced code blocks like this:

```bash
something
```

should be rendered as

<pre><code class="bash">

something

</code></pre>

but are instead rendered as an inline code segment in a paragraph:

<p>

<code>bash

something

</code>

</p>

Q2A version: 1.8.4

1 Answer

0 votes
by

Apparently lack of support for syntax coloring hints is related to an old (yet still unresolved) issue. *sigh*

by
Maybe you can have a look at HtmlLawed.php to see if anything prevents this.
by
You mean `htmLawed.php`? Thanks for the suggestion, but I just took a look, and I clearly don't know enough PHP to understand what that code is doing.
by
To tell the truth, I don't understand all those things either. But you can search for "code" in that file.

Maybe, one of them will remove the style of <code> tags.

You can use "trial and error" technique.
by
There seems to be a misunderstanding. I don't want to remove the style from <code> tags. I want to be able to specify the (language-)style to be used in them in the post.
...