Add flags to enable/disable markdown extra footnotes

This commit is contained in:
david parsons
2011-01-13 12:02:12 -08:00
parent c9e216dafb
commit 5a019adc0c
5 changed files with 8 additions and 2 deletions
+1
View File
@@ -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])
+3 -2
View File
@@ -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;
}
+2
View File
@@ -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])
+1
View File
@@ -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)
+1
View File
@@ -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()