cmark

My personal build of CMark ✏️

Commit
f5f7efaa74b56f732bc67adcd69b8e7b5c582ebe
Parent
8a023286198a7e408398e282f293e3b0baebb644
Author
Pablo <pablo-escobar@riseup.net>
Date

Changed the code to emmit code compatible with my CSS sheets

Diffstat

1 file changed, 6 insertions, 6 deletions

Status File Name N° Changes Insertions Deletions
Modified src/html.c 12 6 6
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: