]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: Add '--nosmart' option to disable smart typography
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 16 Jun 2017 23:01:45 +0000 (19:01 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 16 Jun 2017 23:01:45 +0000 (19:01 -0400)
Sources/libMultiMarkdown/include/libMultiMarkdown.h
Sources/multimarkdown/main.c

index a523c56fac1121c7da99465c451f8970a9e4b93b..c890167b3f633a2f376f278f4481389509af1923 100644 (file)
@@ -487,24 +487,17 @@ enum parser_extensions {
        EXT_COMPATIBILITY       = 1 << 0,    //!< Markdown compatibility mode
        EXT_COMPLETE            = 1 << 1,    //!< Create complete document
        EXT_SNIPPET             = 1 << 2,    //!< Create snippet only
-       EXT_HEAD_CLOSED         = 1 << 3,    //!< for use by parser
-       EXT_SMART               = 1 << 4,    //!< Enable Smart quotes
-       EXT_NOTES               = 1 << 5,    //!< Enable Footnotes
-       EXT_NO_LABELS           = 1 << 6,    //!< Don't add anchors to headers, etc.
-       EXT_FILTER_STYLES       = 1 << 7,    //!< Filter out style blocks
-       EXT_FILTER_HTML         = 1 << 8,    //!< Filter out raw HTML
-       EXT_PROCESS_HTML        = 1 << 9,    //!< Process Markdown inside HTML
-       EXT_NO_METADATA         = 1 << 10,   //!< Don't parse Metadata
-       EXT_OBFUSCATE           = 1 << 11,   //!< Mask email addresses
-       EXT_CRITIC              = 1 << 12,   //!< Critic Markup Support
-       EXT_CRITIC_ACCEPT       = 1 << 13,   //!< Accept all proposed changes
-       EXT_CRITIC_REJECT       = 1 << 14,   //!< Reject all proposed changes
-       EXT_RANDOM_FOOT         = 1 << 15,   //!< Use random numbers for footnote links
-       EXT_HEADINGSECTION      = 1 << 16,   //!< Group blocks under parent heading
-       EXT_ESCAPED_LINE_BREAKS = 1 << 17,   //!< Escaped line break
-       EXT_NO_STRONG           = 1 << 18,   //!< Don't allow nested \<strong\>'s
-       EXT_NO_EMPH             = 1 << 19,   //!< Don't allow nested \<emph\>'s
-       EXT_TRANSCLUDE          = 1 << 20,   //!< Perform transclusion(s)
+       EXT_SMART               = 1 << 3,    //!< Enable Smart quotes
+       EXT_NOTES               = 1 << 4,    //!< Enable Footnotes
+       EXT_NO_LABELS           = 1 << 5,    //!< Don't add anchors to headers, etc.
+       EXT_PROCESS_HTML        = 1 << 6,    //!< Process Markdown inside HTML
+       EXT_NO_METADATA         = 1 << 7,   //!< Don't parse Metadata
+       EXT_OBFUSCATE           = 1 << 8,   //!< Mask email addresses
+       EXT_CRITIC              = 1 << 9,   //!< Critic Markup Support
+       EXT_CRITIC_ACCEPT       = 1 << 10,   //!< Accept all proposed changes
+       EXT_CRITIC_REJECT       = 1 << 11,   //!< Reject all proposed changes
+       EXT_RANDOM_FOOT         = 1 << 12,   //!< Use random numbers for footnote links
+       EXT_TRANSCLUDE          = 1 << 13,   //!< Perform transclusion(s)
        EXT_FAKE                = 1 << 31,   //!< 31 is highest number allowed
 };
 
index fd49bd1a19ab4a5ae00306d4073676a184cdce06..1f943f336aa562a0eb2f77bc3900f32fbf953f41 100644 (file)
@@ -73,7 +73,7 @@
 // argtable structs
 struct arg_lit *a_help, *a_version, *a_compatibility, *a_nolabels, *a_batch,
                *a_accept, *a_reject, *a_full, *a_snippet, *a_random, *a_meta,
-               *a_notransclude;
+               *a_notransclude, *a_nosmart;
 struct arg_str *a_format, *a_lang, *a_extract;
 struct arg_file *a_file, *a_o;
 struct arg_end *a_end;
@@ -147,6 +147,7 @@ int main(int argc, char** argv) {
                a_snippet               = arg_lit0("s", "snippet", "force a snippet"),
                a_compatibility = arg_lit0("c", "compatibility", "Markdown compatibility mode"),
                a_random                = arg_lit0(NULL, "random", "use random numbers for footnote anchors"),
+               a_nosmart               = arg_lit0(NULL, "nosmart", "Disable smart typography"),
                a_nolabels              = arg_lit0(NULL, "nolabels", "Disable id attributes for headers"),
                a_notransclude  = arg_lit0(NULL, "notransclude", "Disable file transclusion"),
 
@@ -219,6 +220,11 @@ int main(int argc, char** argv) {
                extensions = EXT_COMPATIBILITY | EXT_NO_LABELS | EXT_OBFUSCATE;
        }
 
+       if (a_nosmart->count > 0) {
+               // Disable smart typography
+               extensions &= ~EXT_SMART;
+       }
+
        if (a_nolabels->count > 0) {
                // Disable header id attributes
                extensions |= EXT_NO_LABELS;