diff options
author | Vicent Marti <tanoku@gmail.com> | 2014-09-09 03:42:05 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2014-09-09 03:42:05 +0200 |
commit | 2c06fa95fd3059a099bbe403beaf62f2e033f5b7 (patch) | |
tree | 19290fa158f0d96458ba2fcaeb190e3b142561ff /src/html | |
parent | 7426f9ae60272a19bd4611b8579647118033a1e6 (diff) |
Fix the class attribute for code fences
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/html.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/html/html.c b/src/html/html.c index 129335f..74f6791 100644 --- a/src/html/html.c +++ b/src/html/html.c @@ -99,7 +99,7 @@ void blocks_to_html(strbuf *html, node_block *b, bool tight) case BLOCK_FENCED_CODE: cr(html); - strbuf_puts(html, "<pre"); + strbuf_puts(html, "<pre><code"); if (b->tag == BLOCK_FENCED_CODE) { strbuf *info = &b->as.code.info; @@ -109,14 +109,13 @@ void blocks_to_html(strbuf *html, node_block *b, bool tight) if (first_tag < 0) first_tag = strbuf_len(info); - - strbuf_puts(html, " class=\""); + strbuf_puts(html, " class=\"lang-"); escape_html(html, info->ptr, first_tag); strbuf_putc(html, '"'); } } - strbuf_puts(html, "><code>"); + strbuf_putc(html, '>'); escape_html(html, b->string_content.ptr, b->string_content.size); strbuf_puts(html, "</code></pre>\n"); break; |