Commit a470fbf8c3c1053fc58c93d66ea943c09f222ed5

Martin Mitas 2022-01-13T20:34:47

md2html: Change interpretation of --github and --commonmark options. Previously these assigned a set of parser flags with an operator '='. Now '|=' is used so that any preceding options affecting what extensions to allow are not ignored.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/md2html/md2html.c b/md2html/md2html.c
index c959bfc..06b2b74 100644
--- a/md2html/md2html.c
+++ b/md2html/md2html.c
@@ -315,8 +315,8 @@ cmdline_callback(int opt, char const* value, void* data)
         case 'h':   usage(); exit(0); break;
         case 'v':   version(); exit(0); break;
 
-        case 'c':   parser_flags = MD_DIALECT_COMMONMARK; break;
-        case 'g':   parser_flags = MD_DIALECT_GITHUB; break;
+        case 'c':   parser_flags |= MD_DIALECT_COMMONMARK; break;
+        case 'g':   parser_flags |= MD_DIALECT_GITHUB; break;
 
         case 'E':   renderer_flags |= MD_HTML_FLAG_VERBATIM_ENTITIES; break;
         case 'A':   parser_flags |= MD_FLAG_PERMISSIVEATXHEADERS; break;