Question:
My class’s primary language is Hebrew, which is written from right to left. I’d like to provide project instructions in Hebrew. Unfortunately, Markdown doesn’t seem to support right-to-left languages. However, there’s a workaround: using raw HTML to wrap all the instruction code inside a <div dir="rtl", align="right", lang="he">
element (cf. this post).
However, this creates a problem when I wish to incorporate syntax-highlighted code blocks in my instructions. If it weren’t for the enclosing div
element, I could use a Markdown fenced codeblock element and write, say
```python
println("Hello, world!")
```
However, this doesn’t work inside a div
element. Generally speaking, Markdown doesn’t seem to work inside raw HTML elements.
A possible solution would be to end the div
element before the code block, and then enter the code using a Markdown fenced codeblock. However, this disrupts the logical structure of the document, and may also have undesirable practical repercussions. Consider, for instance, a situation in which I wish to provide a code block as one of several items of an ordered list inside an HTML <ol>
element. The automatic numbering of list items and their indentation will be off if I end the ordered list mid-way in order to enter a code block using Markdown.
Most of the Markdown language elements have raw HTML equivalents, for instance the #
(hashtag) Markdown element that indicates a top-level heading can be substituted by the equivalent raw HTML <h1>
element.
Is there a raw HTML equivalent for the fenced codeblock Markdown element for formatting a code block with language-specific syntax highlighting?
I found another post in this forum that may be of help to me. It suggests using highlights.js
. However, I can’t figure out how to deploy highlight.js
in my repl. Help will be appreciated.