bluecloth 2.0.5-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/ChangeLog +784 -0
  2. data/LICENSE +27 -0
  3. data/LICENSE.discount +47 -0
  4. data/README +81 -0
  5. data/Rakefile +346 -0
  6. data/Rakefile.local +63 -0
  7. data/bin/bluecloth +84 -0
  8. data/ext/Csio.c +61 -0
  9. data/ext/VERSION +1 -0
  10. data/ext/amalloc.h +29 -0
  11. data/ext/bluecloth.c +377 -0
  12. data/ext/config.h +51 -0
  13. data/ext/css.c +76 -0
  14. data/ext/cstring.h +74 -0
  15. data/ext/docheader.c +43 -0
  16. data/ext/extconf.rb +48 -0
  17. data/ext/generate.c +1481 -0
  18. data/ext/markdown.c +970 -0
  19. data/ext/markdown.h +145 -0
  20. data/ext/mkdio.c +303 -0
  21. data/ext/mkdio.h +78 -0
  22. data/ext/resource.c +155 -0
  23. data/ext/version.c +28 -0
  24. data/ext/xml.c +82 -0
  25. data/ext/xmlpage.c +48 -0
  26. data/lib/bluecloth.rb +161 -0
  27. data/rake/191_compat.rb +26 -0
  28. data/rake/dependencies.rb +76 -0
  29. data/rake/helpers.rb +412 -0
  30. data/rake/hg.rb +214 -0
  31. data/rake/manual.rb +782 -0
  32. data/rake/packaging.rb +135 -0
  33. data/rake/publishing.rb +321 -0
  34. data/rake/rdoc.rb +30 -0
  35. data/rake/style.rb +62 -0
  36. data/rake/svn.rb +668 -0
  37. data/rake/testing.rb +187 -0
  38. data/rake/verifytask.rb +64 -0
  39. data/rake/win32.rb +190 -0
  40. data/spec/bluecloth/101_changes_spec.rb +141 -0
  41. data/spec/bluecloth/autolinks_spec.rb +49 -0
  42. data/spec/bluecloth/blockquotes_spec.rb +143 -0
  43. data/spec/bluecloth/code_spans_spec.rb +164 -0
  44. data/spec/bluecloth/emphasis_spec.rb +164 -0
  45. data/spec/bluecloth/entities_spec.rb +65 -0
  46. data/spec/bluecloth/hrules_spec.rb +90 -0
  47. data/spec/bluecloth/images_spec.rb +92 -0
  48. data/spec/bluecloth/inline_html_spec.rb +238 -0
  49. data/spec/bluecloth/links_spec.rb +171 -0
  50. data/spec/bluecloth/lists_spec.rb +294 -0
  51. data/spec/bluecloth/paragraphs_spec.rb +75 -0
  52. data/spec/bluecloth/titles_spec.rb +305 -0
  53. data/spec/bluecloth_spec.rb +250 -0
  54. data/spec/bugfix_spec.rb +136 -0
  55. data/spec/contributions_spec.rb +85 -0
  56. data/spec/data/antsugar.txt +34 -0
  57. data/spec/data/markdowntest/Amps and angle encoding.html +17 -0
  58. data/spec/data/markdowntest/Amps and angle encoding.text +21 -0
  59. data/spec/data/markdowntest/Auto links.html +18 -0
  60. data/spec/data/markdowntest/Auto links.text +13 -0
  61. data/spec/data/markdowntest/Backslash escapes.html +118 -0
  62. data/spec/data/markdowntest/Backslash escapes.text +120 -0
  63. data/spec/data/markdowntest/Blockquotes with code blocks.html +15 -0
  64. data/spec/data/markdowntest/Blockquotes with code blocks.text +11 -0
  65. data/spec/data/markdowntest/Code Blocks.html +18 -0
  66. data/spec/data/markdowntest/Code Blocks.text +14 -0
  67. data/spec/data/markdowntest/Code Spans.html +5 -0
  68. data/spec/data/markdowntest/Code Spans.text +5 -0
  69. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.html +8 -0
  70. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.text +8 -0
  71. data/spec/data/markdowntest/Horizontal rules.html +71 -0
  72. data/spec/data/markdowntest/Horizontal rules.text +67 -0
  73. data/spec/data/markdowntest/Inline HTML (Advanced).html +15 -0
  74. data/spec/data/markdowntest/Inline HTML (Advanced).text +15 -0
  75. data/spec/data/markdowntest/Inline HTML (Simple).html +72 -0
  76. data/spec/data/markdowntest/Inline HTML (Simple).text +69 -0
  77. data/spec/data/markdowntest/Inline HTML comments.html +13 -0
  78. data/spec/data/markdowntest/Inline HTML comments.text +13 -0
  79. data/spec/data/markdowntest/Links, inline style.html +11 -0
  80. data/spec/data/markdowntest/Links, inline style.text +12 -0
  81. data/spec/data/markdowntest/Links, reference style.html +52 -0
  82. data/spec/data/markdowntest/Links, reference style.text +71 -0
  83. data/spec/data/markdowntest/Links, shortcut references.html +9 -0
  84. data/spec/data/markdowntest/Links, shortcut references.text +20 -0
  85. data/spec/data/markdowntest/Literal quotes in titles.html +3 -0
  86. data/spec/data/markdowntest/Literal quotes in titles.text +7 -0
  87. data/spec/data/markdowntest/Markdown Documentation - Basics.html +314 -0
  88. data/spec/data/markdowntest/Markdown Documentation - Basics.text +306 -0
  89. data/spec/data/markdowntest/Markdown Documentation - Syntax.html +942 -0
  90. data/spec/data/markdowntest/Markdown Documentation - Syntax.text +888 -0
  91. data/spec/data/markdowntest/Nested blockquotes.html +9 -0
  92. data/spec/data/markdowntest/Nested blockquotes.text +5 -0
  93. data/spec/data/markdowntest/Ordered and unordered lists.html +148 -0
  94. data/spec/data/markdowntest/Ordered and unordered lists.text +131 -0
  95. data/spec/data/markdowntest/Strong and em together.html +7 -0
  96. data/spec/data/markdowntest/Strong and em together.text +7 -0
  97. data/spec/data/markdowntest/Tabs.html +25 -0
  98. data/spec/data/markdowntest/Tabs.text +21 -0
  99. data/spec/data/markdowntest/Tidyness.html +8 -0
  100. data/spec/data/markdowntest/Tidyness.text +5 -0
  101. data/spec/data/ml-announce.txt +17 -0
  102. data/spec/data/re-overflow.txt +67 -0
  103. data/spec/data/re-overflow2.txt +281 -0
  104. data/spec/discount_spec.rb +67 -0
  105. data/spec/lib/constants.rb +5 -0
  106. data/spec/lib/helpers.rb +137 -0
  107. data/spec/lib/matchers.rb +235 -0
  108. data/spec/markdowntest_spec.rb +79 -0
  109. metadata +329 -0
data/ext/markdown.h ADDED
@@ -0,0 +1,145 @@
1
+ #ifndef _MARKDOWN_D
2
+ #define _MARKDOWN_D
3
+
4
+ #include "cstring.h"
5
+
6
+ /* reference-style links (and images) are stored in an array
7
+ * of footnotes.
8
+ */
9
+ typedef struct footnote {
10
+ Cstring tag; /* the tag for the reference link */
11
+ Cstring link; /* what this footnote points to */
12
+ Cstring title; /* what it's called (TITLE= attribute) */
13
+ int height, width; /* dimensions (for image link) */
14
+ int dealloc; /* deallocation needed? */
15
+ } Footnote;
16
+
17
+ /* each input line is read into a Line, which contains the line,
18
+ * the offset of the first non-space character [this assumes
19
+ * that all tabs will be expanded to spaces!], and a pointer to
20
+ * the next line.
21
+ */
22
+ typedef struct line {
23
+ Cstring text;
24
+ struct line *next;
25
+ int dle;
26
+ } Line;
27
+
28
+
29
+ /* a paragraph is a collection of Lines, with links to the next paragraph
30
+ * and (if it's a QUOTE, UL, or OL) to the reparsed contents of this
31
+ * paragraph.
32
+ */
33
+ typedef struct paragraph {
34
+ struct paragraph *next; /* next paragraph */
35
+ struct paragraph *down; /* recompiled contents of this paragraph */
36
+ struct line *text; /* all the text in this paragraph */
37
+ char *ident; /* %id% tag for QUOTE */
38
+ enum { WHITESPACE=0, CODE, QUOTE, MARKUP,
39
+ HTML, STYLE, DL, UL, OL, AL, LISTITEM,
40
+ HDR, HR } typ;
41
+ enum { IMPLICIT=0, PARA, CENTER} align;
42
+ int hnumber; /* <Hn> for typ == HDR */
43
+ } Paragraph;
44
+
45
+ enum { ETX, SETEXT }; /* header types */
46
+
47
+
48
+ typedef struct block {
49
+ enum { bTEXT, bSTAR, bUNDER } b_type;
50
+ int b_count;
51
+ char b_char;
52
+ Cstring b_text;
53
+ Cstring b_post;
54
+ } block;
55
+
56
+ typedef STRING(block) Qblock;
57
+
58
+
59
+ /* a magic markdown io thing holds all the data structures needed to
60
+ * do the backend processing of a markdown document
61
+ */
62
+ typedef struct mmiot {
63
+ Cstring out;
64
+ Cstring in;
65
+ Qblock Q;
66
+ int isp;
67
+ STRING(Footnote) *footnotes;
68
+ int flags;
69
+ #define DENY_A 0x0001
70
+ #define DENY_IMG 0x0002
71
+ #define DENY_SMARTY 0x0004
72
+ #define DENY_HTML 0x0008
73
+ #define STRICT 0x0010
74
+ #define INSIDE_TAG 0x0020
75
+ #define NO_PSEUDO_PROTO 0x0040
76
+ #define CDATA_OUTPUT 0x0080
77
+ #define TOC 0x1000
78
+ #define MKD_1_COMPAT 0x2000
79
+ #define AUTOLINK 0x4000
80
+ #define SAFELINK 0x8000
81
+ #define USER_FLAGS 0xF0FF
82
+ #define EMBEDDED DENY_A|DENY_IMG|NO_PSEUDO_PROTO|CDATA_OUTPUT
83
+ char *base;
84
+ } MMIOT;
85
+
86
+
87
+ /*
88
+ * the mkdio text input functions return a document structure,
89
+ * which contains a header (retrieved from the document if
90
+ * markdown was configured * with the * --enable-pandoc-header
91
+ * and the document begins with a pandoc-style header) and the
92
+ * root of the linked list of Lines.
93
+ */
94
+ typedef struct document {
95
+ Line *headers; /* title -> author(s) -> date */
96
+ ANCHOR(Line) content; /* uncompiled text, not valid after compile() */
97
+ Paragraph *code; /* intermediate code generated by compile() */
98
+ int compiled; /* set after mkd_compile() */
99
+ int html; /* set after (internal) htmlify() */
100
+ int tabstop; /* for properly expanding tabs (ick) */
101
+ MMIOT *ctx; /* backend buffers, flags, and structures */
102
+ char *base; /* url basename for url fragments */
103
+ } Document;
104
+
105
+
106
+ extern int mkd_firstnonblank(Line *);
107
+ extern int mkd_compile(Document *, int);
108
+ extern int mkd_document(Document *, char **);
109
+ extern int mkd_generatehtml(Document *, FILE *);
110
+ extern int mkd_css(Document *, char **);
111
+ extern int mkd_generatecss(Document *, FILE *);
112
+ #define mkd_style mkd_generatecss
113
+ extern int mkd_xml(char *, int , char **);
114
+ extern int mkd_generatexml(char *, int, FILE *);
115
+ extern void mkd_cleanup(Document *);
116
+ extern int mkd_line(char *, int, char **, int);
117
+ extern int mkd_generateline(char *, int, FILE*, int);
118
+ #define mkd_text mkd_generateline
119
+ extern void mkd_basename(Document*, char *);
120
+ extern void mkd_string_to_anchor(char*,int, void(*)(int,void*), void*);
121
+
122
+ extern Document *mkd_in(FILE *, int);
123
+ extern Document *mkd_string(char*,int, int);
124
+
125
+ #define NO_HEADER 0x0100
126
+ #define STD_TABSTOP 0x0200
127
+ #define INPUT_MASK (NO_HEADER|STD_TABSTOP)
128
+
129
+
130
+ /* internal resource handling functions.
131
+ */
132
+ extern void ___mkd_freeLine(Line *);
133
+ extern void ___mkd_freeLines(Line *);
134
+ extern void ___mkd_freeParagraph(Paragraph *);
135
+ extern void ___mkd_freefootnote(Footnote *);
136
+ extern void ___mkd_freefootnotes(MMIOT *);
137
+ extern void ___mkd_initmmiot(MMIOT *, void *);
138
+ extern void ___mkd_freemmiot(MMIOT *, void *);
139
+ extern void ___mkd_freeLineRange(Line *, Line *);
140
+ extern void ___mkd_xml(char *, int, FILE *);
141
+ extern void ___mkd_reparse(char *, int, int, MMIOT*);
142
+ extern void ___mkd_emblock(MMIOT*);
143
+ extern void ___mkd_tidy(Cstring *);
144
+
145
+ #endif/*_MARKDOWN_D*/
data/ext/mkdio.c ADDED
@@ -0,0 +1,303 @@
1
+ /*
2
+ * mkdio -- markdown front end input functions
3
+ *
4
+ * Copyright (C) 2007 David L Parsons.
5
+ * The redistribution terms are provided in the COPYRIGHT file that must
6
+ * be distributed with this source code.
7
+ */
8
+ #include "config.h"
9
+ #include <stdio.h>
10
+ #include <stdlib.h>
11
+ #include <ctype.h>
12
+
13
+ #include "cstring.h"
14
+ #include "markdown.h"
15
+ #include "amalloc.h"
16
+
17
+ typedef ANCHOR(Line) LineAnchor;
18
+
19
+ /* create a new blank Document
20
+ */
21
+ static Document*
22
+ new_Document()
23
+ {
24
+ Document *ret = calloc(sizeof(Document), 1);
25
+
26
+ if ( ret ) {
27
+ if (( ret->ctx = calloc(sizeof(MMIOT), 1) ))
28
+ return ret;
29
+ free(ret);
30
+ }
31
+ return 0;
32
+ }
33
+
34
+
35
+ /* add a line to the markdown input chain
36
+ */
37
+ static void
38
+ queue(Document* a, Cstring *line)
39
+ {
40
+ Line *p = calloc(sizeof *p, 1);
41
+ unsigned char c;
42
+ int xp = 0;
43
+ int size = S(*line);
44
+ unsigned char *str = (unsigned char*)T(*line);
45
+
46
+ CREATE(p->text);
47
+ ATTACH(a->content, p);
48
+
49
+ while ( size-- ) {
50
+ if ( (c = *str++) == '\t' ) {
51
+ /* expand tabs into ->tabstop spaces. We use ->tabstop
52
+ * because the ENTIRE FREAKING COMPUTER WORLD uses editors
53
+ * that don't do ^T/^D, but instead use tabs for indentation,
54
+ * and, of course, set their tabs down to 4 spaces
55
+ */
56
+ do {
57
+ EXPAND(p->text) = ' ';
58
+ } while ( ++xp % a->tabstop );
59
+ }
60
+ else if ( c >= ' ' ) {
61
+ EXPAND(p->text) = c;
62
+ ++xp;
63
+ }
64
+ }
65
+ EXPAND(p->text) = 0;
66
+ S(p->text)--;
67
+ p->dle = mkd_firstnonblank(p);
68
+ }
69
+
70
+
71
+ #ifdef PANDOC_HEADER
72
+ /* trim leading blanks from a header line
73
+ */
74
+ static void
75
+ snip(Line *p)
76
+ {
77
+ CLIP(p->text, 0, 1);
78
+ p->dle = mkd_firstnonblank(p);
79
+ }
80
+ #endif
81
+
82
+
83
+ /* build a Document from any old input.
84
+ */
85
+ typedef int (*getc_func)(void*);
86
+
87
+ Document *
88
+ populate(getc_func getc, void* ctx, int flags)
89
+ {
90
+ Cstring line;
91
+ Document *a = new_Document();
92
+ int c;
93
+ #ifdef PANDOC_HEADER
94
+ int pandoc = 0;
95
+ #endif
96
+
97
+ if ( !a ) return 0;
98
+
99
+ a->tabstop = (flags & STD_TABSTOP) ? 4 : TABSTOP;
100
+
101
+ CREATE(line);
102
+
103
+ while ( (c = (*getc)(ctx)) != EOF ) {
104
+ if ( c == '\n' ) {
105
+ #ifdef PANDOC_HEADER
106
+ if ( pandoc != EOF && pandoc < 3 ) {
107
+ if ( S(line) && (T(line)[0] == '%') )
108
+ pandoc++;
109
+ else
110
+ pandoc = EOF;
111
+ }
112
+ #endif
113
+ queue(a, &line);
114
+ S(line) = 0;
115
+ }
116
+ else if ( isprint(c) || isspace(c) || (c & 0x80) )
117
+ EXPAND(line) = c;
118
+ }
119
+
120
+ if ( S(line) )
121
+ queue(a, &line);
122
+
123
+ DELETE(line);
124
+
125
+ #ifdef PANDOC_HEADER
126
+ if ( (pandoc == 3) && !(flags & NO_HEADER) ) {
127
+ /* the first three lines started with %, so we have a header.
128
+ * clip the first three lines out of content and hang them
129
+ * off header.
130
+ */
131
+ a->headers = T(a->content);
132
+ T(a->content) = a->headers->next->next->next;
133
+ a->headers->next->next->next = 0;
134
+ snip(a->headers);
135
+ snip(a->headers->next);
136
+ snip(a->headers->next->next);
137
+ }
138
+ #endif
139
+
140
+ return a;
141
+ }
142
+
143
+
144
+ /* convert a file into a linked list
145
+ */
146
+ Document *
147
+ mkd_in(FILE *f, int flags)
148
+ {
149
+ return populate((getc_func)fgetc, f, flags & INPUT_MASK);
150
+ }
151
+
152
+
153
+ /* return a single character out of a buffer
154
+ */
155
+ struct string_ctx {
156
+ char *data; /* the unread data */
157
+ int size; /* and how much is there? */
158
+ } ;
159
+
160
+
161
+ static int
162
+ strget(struct string_ctx *in)
163
+ {
164
+ if ( !in->size ) return EOF;
165
+
166
+ --(in->size);
167
+
168
+ return *(in->data)++;
169
+ }
170
+
171
+
172
+ /* convert a block of text into a linked list
173
+ */
174
+ Document *
175
+ mkd_string(char *buf, int len, int flags)
176
+ {
177
+ struct string_ctx about;
178
+
179
+ about.data = buf;
180
+ about.size = len;
181
+
182
+ return populate((getc_func)strget, &about, flags & INPUT_MASK);
183
+ }
184
+
185
+
186
+ /* write the html to a file (xmlified if necessary)
187
+ */
188
+ int
189
+ mkd_generatehtml(Document *p, FILE *output)
190
+ {
191
+ char *doc;
192
+ int szdoc;
193
+
194
+ if ( (szdoc = mkd_document(p, &doc)) != EOF ) {
195
+ if ( p->ctx->flags & CDATA_OUTPUT )
196
+ mkd_generatexml(doc, szdoc, output);
197
+ else
198
+ fwrite(doc, szdoc, 1, output);
199
+ putc('\n', output);
200
+ return 0;
201
+ }
202
+ return -1;
203
+ }
204
+
205
+
206
+ /* convert some markdown text to html
207
+ */
208
+ int
209
+ markdown(Document *document, FILE *out, int flags)
210
+ {
211
+ if ( mkd_compile(document, flags) ) {
212
+ mkd_generatehtml(document, out);
213
+ mkd_cleanup(document);
214
+ return 0;
215
+ }
216
+ return -1;
217
+ }
218
+
219
+
220
+ void
221
+ mkd_basename(Document *document, char *base)
222
+ {
223
+ if ( document )
224
+ document->base = base;
225
+ }
226
+
227
+
228
+ /* write out a Cstring, mangled into a form suitable for `<a href=` or `<a id=`
229
+ */
230
+ void
231
+ mkd_string_to_anchor(char *s, int len, void(*outchar)(int,void*), void *out)
232
+ {
233
+ unsigned char c;
234
+
235
+ for ( ; len-- > 0; ) {
236
+ c = *s++;
237
+ if ( c == ' ' || c == '&' || c == '<' || c == '"' )
238
+ (*outchar)('+', out);
239
+ else if ( isalnum(c) || ispunct(c) || (c & 0x80) )
240
+ (*outchar)(c, out);
241
+ else
242
+ (*outchar)('~',out);
243
+ }
244
+ }
245
+
246
+
247
+ /* ___mkd_reparse() a line
248
+ */
249
+ static void
250
+ mkd_parse_line(char *bfr, int size, MMIOT *f, int flags)
251
+ {
252
+ ___mkd_initmmiot(f, 0);
253
+ f->flags = flags & USER_FLAGS;
254
+ ___mkd_reparse(bfr, size, 0, f);
255
+ ___mkd_emblock(f);
256
+ }
257
+
258
+
259
+ /* ___mkd_reparse() a line, returning it in malloc()ed memory
260
+ */
261
+ int
262
+ mkd_line(char *bfr, int size, char **res, int flags)
263
+ {
264
+ MMIOT f;
265
+ int len;
266
+
267
+ mkd_parse_line(bfr, size, &f, flags);
268
+
269
+ if ( len = S(f.out) ) {
270
+ /* kludge alert; we know that T(f.out) is malloced memory,
271
+ * so we can just steal it away. This is awful -- there
272
+ * should be an opaque method that transparently moves
273
+ * the pointer out of the embedded Cstring.
274
+ */
275
+ *res = T(f.out);
276
+ T(f.out) = 0;
277
+ S(f.out) = 0;
278
+ }
279
+ else {
280
+ *res = 0;
281
+ len = EOF;
282
+ }
283
+ ___mkd_freemmiot(&f, 0);
284
+ return len;
285
+ }
286
+
287
+
288
+ /* ___mkd_reparse() a line, writing it to a FILE
289
+ */
290
+ int
291
+ mkd_generateline(char *bfr, int size, FILE *output, int flags)
292
+ {
293
+ MMIOT f;
294
+
295
+ mkd_parse_line(bfr, size, &f, flags);
296
+ if ( flags & CDATA_OUTPUT )
297
+ mkd_generatexml(T(f.out), S(f.out), output);
298
+ else
299
+ fwrite(T(f.out), S(f.out), 1, output);
300
+
301
+ ___mkd_freemmiot(&f, 0);
302
+ return 0;
303
+ }
data/ext/mkdio.h ADDED
@@ -0,0 +1,78 @@
1
+ #ifndef _MKDIO_D
2
+ #define _MKDIO_D
3
+
4
+ #include <stdio.h>
5
+
6
+ typedef void MMIOT;
7
+
8
+ /* line builder for markdown()
9
+ */
10
+ MMIOT *mkd_in(FILE*,int); /* assemble input from a file */
11
+ MMIOT *mkd_string(char*,int,int); /* assemble input from a buffer */
12
+
13
+ void mkd_basename(MMIOT*,char*);
14
+
15
+ /* compilation, debugging, cleanup
16
+ */
17
+ int mkd_compile(MMIOT*, int);
18
+ int mkd_cleanup(MMIOT*);
19
+
20
+ /* markup functions
21
+ */
22
+ int mkd_dump(MMIOT*, FILE*, int, char*);
23
+ int markdown(MMIOT*, FILE*, int);
24
+ int mkd_line(char *, int, char **, int);
25
+ void mkd_string_to_anchor(char *, int, int (*)(int,void*), void*);
26
+ int mkd_xhtmlpage(MMIOT*,int,FILE*);
27
+
28
+ /* header block access
29
+ */
30
+ char* mkd_doc_title(MMIOT*);
31
+ char* mkd_doc_author(MMIOT*);
32
+ char* mkd_doc_date(MMIOT*);
33
+
34
+ /* compiled data access
35
+ */
36
+ int mkd_document(MMIOT*, char**);
37
+ int mkd_toc(MMIOT*, char**);
38
+ int mkd_css(MMIOT*, char **);
39
+ int mkd_xml(char *, int, char **);
40
+
41
+ /* write-to-file functions
42
+ */
43
+ int mkd_generatehtml(MMIOT*,FILE*);
44
+ int mkd_generatetoc(MMIOT*,FILE*);
45
+ int mkd_generatexml(char *, int,FILE*);
46
+ int mkd_generatecss(MMIOT*,FILE*);
47
+ #define mkd_style mkd_generatecss
48
+ int mkd_generateline(char *, int, FILE*, int);
49
+ #define mkd_text mkd_generateline
50
+
51
+ /* version#.
52
+ */
53
+ extern char markdown_version[];
54
+
55
+ /* special flags for markdown() and mkd_text()
56
+ */
57
+ #define MKD_NOLINKS 0x0001 /* don't do link processing, block <a> tags */
58
+ #define MKD_NOIMAGE 0x0002 /* don't do image processing, block <img> */
59
+ #define MKD_NOPANTS 0x0004 /* don't run smartypants() */
60
+ #define MKD_NOHTML 0x0008 /* don't allow raw html through AT ALL */
61
+ #define MKD_STRICT 0x0010 /* disable SUPERSCRIPT, RELAXED_EMPHASIS */
62
+ #define MKD_TAGTEXT 0x0020 /* process text inside an html tag; no
63
+ * <em>, no <bold>, no html or [] expansion */
64
+ #define MKD_NO_EXT 0x0040 /* don't allow pseudo-protocols */
65
+ #define MKD_CDATA 0x0080 /* generate code for xml ![CDATA[...]] */
66
+ #define MKD_TOC 0x1000 /* do table-of-contents processing */
67
+ #define MKD_1_COMPAT 0x2000 /* compatability with MarkdownTest_1.0 */
68
+ #define MKD_AUTOLINK 0x4000 /* make http://foo.com link even without <>s */
69
+ #define MKD_SAFELINK 0x8000 /* paranoid check for link protocol */
70
+ #define MKD_EMBED MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT
71
+
72
+ /* special flags for mkd_in() and mkd_string()
73
+ */
74
+ #define MKD_NOHEADER 0x0100 /* don't process header blocks */
75
+ #define MKD_TABSTOP 0x0200 /* expand tabs to 4 spaces */
76
+
77
+
78
+ #endif/*_MKDIO_D*/