Permalink
Browse files

Merge pull request #336 from orta/master

Use Github Flavoured Markdown as default markdown renderer
  • Loading branch information...
2 parents c16d267 + 5af6835 commit 81cf405bafa71f9519ecd9b2c94b1e9786684c8a @tomaz committed Mar 9, 2013
@@ -233,7 +233,7 @@ - (NSString *)stringByConvertingMarkdownToHTML:(NSString *)markdown {
const char* input=[markdown cStringUsingEncoding:NSUTF8StringEncoding];
if(input) {
- MMIOT *document = mkd_string((char *)input, (int)strlen(input), 0);
+ MMIOT *document = gfm_string((char *)input, (int)strlen(input), 0);
mkd_compile(document, 0);
char *html = NULL;
@@ -12,6 +12,11 @@ typedef unsigned int mkd_flag_t;
MMIOT *mkd_in(FILE*,mkd_flag_t); /* assemble input from a file */
MMIOT *mkd_string(const char*,int,mkd_flag_t); /* assemble input from a buffer */
+/* line builder for github flavoured markdown
+ */
+MMIOT *gfm_in(FILE*,mkd_flag_t); /* assemble input from a file */
+MMIOT *gfm_string(const char*,int,mkd_flag_t); /* assemble input from a buffer */
+
void mkd_basename(MMIOT*,char*);
void mkd_initialize();
@@ -82,8 +87,9 @@ void mkd_ref_prefix(MMIOT*, char*);
#define MKD_NOHTML 0x00000008 /* don't allow raw html through AT ALL */
#define MKD_STRICT 0x00000010 /* disable SUPERSCRIPT, RELAXED_EMPHASIS */
#define MKD_TAGTEXT 0x00000020 /* process text inside an html tag; no
- * <em>, no <bold>, no html or [] expansion */
+* <em>, no <bold>, no html or [] expansion */
#define MKD_NO_EXT 0x00000040 /* don't allow pseudo-protocols */
+#define MKD_NOEXT MKD_NO_EXT /* ^^^ (aliased for user convenience) */
#define MKD_CDATA 0x00000080 /* generate code for xml ![CDATA[...]] */
#define MKD_NOSUPERSCRIPT 0x00000100 /* no A^B */
#define MKD_NORELAXED 0x00000200 /* emphasis happens /everywhere/ */
@@ -99,6 +105,7 @@ void mkd_ref_prefix(MMIOT*, char*);
#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_NOSTYLE 0x00400000 /* don't extract <style> blocks */
#define MKD_EMBED MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT
/* special flags for mkd_in() and mkd_string()
Binary file not shown.

0 comments on commit 81cf405

Please sign in to comment.