diff --git a/flags.c b/flags.c index 4021a8b..5bf206c 100644 --- a/flags.c +++ b/flags.c @@ -28,6 +28,7 @@ static struct flagnames flagnames[] = { { MKD_NODIVQUOTE, "!DIVQUOTE" }, { MKD_NOALPHALIST, "!ALPHALIST" }, { MKD_NODLIST, "!DLIST" }, + { MKD_EXTRA_FOOTNOTE, "FOOTNOTE" }, }; #define NR(x) (sizeof x/sizeof x[0]) diff --git a/generate.c b/generate.c index b7ec088..c901f9d 100644 --- a/generate.c +++ b/generate.c @@ -676,7 +676,7 @@ linkylinky(int image, MMIOT *f) mmiotseek(f, implicit_mark); goodlink = !(f->flags & MKD_1_COMPAT); - if ( (!image) && S(name) && T(name)[0] == '^' ) + if ( (f->flags & MKD_EXTRA_FOOTNOTE) && (!image) && S(name) && T(name)[0] == '^' ) extra_footnote = 1; } @@ -1684,7 +1684,8 @@ mkd_document(Document *p, char **res) if ( p && p->compiled ) { if ( ! p->html ) { htmlify(p->code, 0, 0, p->ctx); - mkd_extra_footnotes(p->ctx); + if ( p->ctx->flags & MKD_EXTRA_FOOTNOTE ) + mkd_extra_footnotes(p->ctx); p->html = 1; } diff --git a/main.c b/main.c index 736dc1f..1d47e9c 100644 --- a/main.c +++ b/main.c @@ -64,6 +64,8 @@ static struct { { "alphalist", 1, MKD_NOALPHALIST }, { "definitionlist",1, MKD_NODLIST }, { "1.0", 0, MKD_1_COMPAT }, + { "footnotes", 0, MKD_EXTRA_FOOTNOTE }, + { "footnote", 0, MKD_EXTRA_FOOTNOTE }, } ; #define NR(x) (sizeof x / sizeof x[0]) diff --git a/markdown.h b/markdown.h index 1a70b25..781de55 100644 --- a/markdown.h +++ b/markdown.h @@ -103,6 +103,7 @@ typedef struct mmiot { #define MKD_NODIVQUOTE 0x00040000 #define MKD_NOALPHALIST 0x00080000 #define MKD_NODLIST 0x00100000 +#define MKD_EXTRA_FOOTNOTE 0x00200000 #define IS_LABEL 0x08000000 #define USER_FLAGS 0x0FFFFFFF #define INPUT_MASK (MKD_NOHEADER|MKD_TABSTOP) diff --git a/mkdio.h.in b/mkdio.h.in index 7ab658c..2a50674 100644 --- a/mkdio.h.in +++ b/mkdio.h.in @@ -91,6 +91,7 @@ extern char markdown_version[]; #define MKD_NODIVQUOTE 0x00040000 /* forbid >%class% blocks */ #define MKD_NOALPHALIST 0x00080000 /* forbid alphabetic lists */ #define MKD_NODLIST 0x00100000 /* forbid definition lists */ +#define MKD_EXTRA_FOOTNOTE 0x00200000 /* enable markdown extra-style footnotes */ #define MKD_EMBED MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT /* special flags for mkd_in() and mkd_string()