cmark

Unnamed repository; edit this file 'description' to name the repository.

commit f5f7efaa74b56f732bc67adcd69b8e7b5c582ebe
parent 8a023286198a7e408398e282f293e3b0baebb644
Author: Pablo <pablo-escobar@riseup.net>
Date:   Mon,  3 May 2021 14:04:41 +0000

Changed the code to emmit code compatible with my CSS sheets

Diffstat:
Msrc/html.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
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: