Commit c91d636baf766d88201ab8faad8e011850f5e33b

Martin Mitas 2016-10-04T20:31:26

Rename MD_TEXT_CODEBLOCK to MD_TEXT_CODE. In text callback, caller should not care whether the code is inside a block or inline span of code. Caller should just output it in the verbatim form.

diff --git a/md4c/md4c.c b/md4c/md4c.c
index 0008922..d2ee1f9 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -882,7 +882,7 @@ md_process_block(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
             break;
 
         case MD_BLOCK_CODE:
-            ret = md_process_verbatim_block(ctx, MD_TEXT_CODEBLOCK, lines, n_lines);
+            ret = md_process_verbatim_block(ctx, MD_TEXT_CODE, lines, n_lines);
             break;
 
         case MD_BLOCK_HTML:
diff --git a/md4c/md4c.h b/md4c/md4c.h
index acb77aa..a8227cb 100644
--- a/md4c/md4c.h
+++ b/md4c/md4c.h
@@ -95,10 +95,11 @@ enum MD_TEXTTYPE_tag {
     /* Normal text. */
     MD_TEXT_NORMAL = 0,
 
-    /* Text in a code block (inside MD_BLOCK_CODE).
-     * Includes spaces for indentation and '\n' for new lines.
-     * MD_TEXT_BR and MD_TEXT_SOFTBR are not sent for this kind of text. */
-    MD_TEXT_CODEBLOCK,
+    /* Text in a code block (inside MD_BLOCK_CODE) or inlined code (`code`).
+     * If it is inside MD_BLOCK_CODE, it includes spaces for indentation and
+     * '\n' for new lines. MD_TEXT_BR and MD_TEXT_SOFTBR are not sent for this
+     * kind of text. */
+    MD_TEXT_CODE,
 
     /* Text is a raw HTML. */
     MD_TEXT_HTML