html2markdown icon indicating copy to clipboard operation
html2markdown copied to clipboard

Feat: fenced code blocks

Open martin-martin opened this issue 5 years ago • 2 comments

Changes the representation of <pre><code> to fenced code blocks instead of indented code blocks in Markdown.

Fenced code blocks allow for user-friendly addition of language syntax, e.g.:

```python
print("hello")
```

Syntax highlighting for these types of fenced code blocks is today widely available and make code snippets more legible.

I therefore suggest to replace this as the default rendering of <pre><code>.

martin-martin avatar Sep 17 '20 20:09 martin-martin

@dlon

Thanks! I'm not necessarily opposed to the idea. Fenced code blocks are an extension of standard markdown, though, so it may have to be an option.

Unlike other formats markdown doesn't really have an 'official' spec, and fenced code blocks are kinda of the standard across almost all users of markdown for code.

If anything https://commonmark.org/ is probably 'the standard', and does have fenced back tick codeblocks as part of it. :)

unexceptable avatar Nov 11 '20 06:11 unexceptable