Paweł
Paweł

Reputation: 4526

How to create HTML block of code in readme.md?

I want to replace markdown syntax into html tags in my readme.md file.

In order to replace the inline code ( single backtics ` ) `let a = 10;` I use <code></code> html tag.

How can I replace the markdown code blocks ( triple backtips ``` ) with html tag?

Is there any equivalent? <blockquote>, <samp>, <kbd> seems not to work on github.com or npmjs.com

Upvotes: 0

Views: 2266

Answers (1)

stasiaks
stasiaks

Reputation: 1276

I'm not sure if I understand, but if I do, in most cases, code blocks in HTML are done by nesting <code> in <pre>, so like this:

<pre>
    <code>
        Whatever code you want to show
    </code>
</pre>

Keep in mind, how it looks like depends on CSS for pre code

Upvotes: 2

Related Questions