diff --git a/src/html.c b/src/html.c
@@ -147,9 +147,9 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
cr(html);
if (node->as.code.info == NULL || node->as.code.info[0] == 0) {
- cmark_strbuf_puts(html, "<pre");
+ cmark_strbuf_puts(html, "<div class=\"codeblock\"");
S_render_sourcepos(node, html, options);
- cmark_strbuf_puts(html, "><code>");
+ cmark_strbuf_puts(html, "><pre><code>");
} else {
bufsize_t first_tag = 0;
while (node->as.code.info[first_tag] &&
@@ -157,15 +157,15 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
first_tag += 1;
}
- cmark_strbuf_puts(html, "<pre");
+ cmark_strbuf_puts(html, "<div class=\"codeblock\"");
S_render_sourcepos(node, html, options);
- cmark_strbuf_puts(html, "><code class=\"language-");
+ cmark_strbuf_puts(html, "><pre data-lang=\"");
escape_html(html, node->as.code.info, first_tag);
- cmark_strbuf_puts(html, "\">");
+ cmark_strbuf_puts(html, "\"><code>");
}
escape_html(html, node->data, node->len);
- cmark_strbuf_puts(html, "</code></pre>\n");
+ cmark_strbuf_puts(html, "</code></pre></div>\n");
break;
case CMARK_NODE_HTML_BLOCK: