forked from vsch/flexmark-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extensions.java
215 lines (177 loc) · 6.93 KB
/
Extensions.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
package com.vladsch.flexmark.profiles.pegdown;
public interface Extensions {
/**
* The default, standard markup mode without any extensions.
*/
static final int NONE = 0x00;
/**
* Pretty ellipses, dashes and apostrophes.
*/
static final int SMARTS = 0x01;
/**
* Pretty single and double quotes.
*/
static final int QUOTES = 0x02;
/**
* All of the smartypants prettyfications. Equivalent to SMARTS + QUOTES.
*
* @see <a href="http://daringfireball.net/projects/smartypants/">Smartypants</a>
*/
static final int SMARTYPANTS = SMARTS + QUOTES;
/**
* PHP Markdown Extra style abbreviations.
*
* @see <a href="http://michelf.com/projects/php-markdown/extra/#abbr">PHP Markdown Extra</a>
*/
static final int ABBREVIATIONS = 0x04;
/**
* Enables the parsing of hard wraps as HTML linebreaks. Similar to what github does.
*
* @see <a href="http://github.github.com/github-flavored-markdown">Github-flavored-Markdown</a>
*/
static final int HARDWRAPS = 0x08;
/**
* Enables plain autolinks the way github flavoured markdown implements them.
* With this extension enabled pegdown will intelligently recognize URLs and email addresses
* without any further delimiters and mark them as the respective link type.
*
* @see <a href="http://github.github.com/github-flavored-markdown">Github-flavored-Markdown</a>
*/
static final int AUTOLINKS = 0x10;
/**
* Table support similar to what Multimarkdown offers.
*
* @see <a href="http://fletcherpenney.net/multimarkdown/users_guide/">MultiMarkdown</a>
*/
static final int TABLES = 0x20;
/**
* PHP Markdown Extra style definition lists.
* Additionally supports the small extension proposed in the article referenced below.
*
* @see <a href="http://michelf.com/projects/php-markdown/extra/#def-list">PHP Markdown Extra</a>
* @see <a href="http://www.justatheory.com/computers/markup/modest-markdown-proposal.html">Extension proposal</a>
*/
static final int DEFINITIONS = 0x40;
/**
* PHP Markdown Extra style fenced code blocks.
*
* @see <a href="http://michelf.com/projects/php-markdown/extra/#fenced-code-blocks">PHP Markdown Extra</a>
*/
static final int FENCED_CODE_BLOCKS = 0x80;
/**
* Support [[Wiki-style links]]. URL rendering is performed by the active LinkRenderer.
*
* @see <a href="http://github.github.com/github-flavored-markdown">Github-flavored-Markdown</a>
*/
static final int WIKILINKS = 0x100;
/**
* Support ~~strikethroughs~~ as supported in Pandoc and Github.
*/
static final int STRIKETHROUGH = 0x200;
/**
* Enables anchor links in headers.
*/
static final int ANCHORLINKS = 0x400;
/**
* All available extensions excluding the high word options
*/
static final int UNUSED_ALL = 0x0000F800;
static final int ALL = 0x0000FFFF;
/**
* Suppresses HTML blocks. They will be accepted in the input but not be contained in the output.
*/
static final int SUPPRESS_HTML_BLOCKS = 0x00010000;
/**
* Suppresses inline HTML tags. They will be accepted in the input but not be contained in the output.
*/
static final int SUPPRESS_INLINE_HTML = 0x00020000;
/**
* Suppresses HTML blocks as well as inline HTML tags.
* Both will be accepted in the input but not be contained in the output.
*/
static final int SUPPRESS_ALL_HTML = 0x00030000;
/**
* Requires a space char after Atx # header prefixes, so that #dasdsdaf is not a header.
*/
static final int ATXHEADERSPACE = 0x00040000;
/**
* Force List and Definition Paragraph wrapping if it includes more than just a single paragraph
*/
static final int SUBSCRIPT = 0x00080000;
/**
* Allow horizontal rules without a blank line following them.
*/
static final int RELAXEDHRULES = 0x00100000;
/**
* GitHub style task list items: - [ ] and - [x]
*/
static final int TASKLISTITEMS = 0x00200000;
/**
* Generate anchor links for headers using complete contents of the header.
* Spaces and non-alphanumerics replaced by `-`, multiple dashes trimmed to one.
* Anchor link is added as first element inside the header with empty content: `<h1><a name="header-a"></a>header a</h1>`
*/
static final int EXTANCHORLINKS = 0x00400000;
/**
* EXTANCHORLINKS should wrap header content instead of creating an empty anchor: `<h1><a name="header-a">header a</a></h1>`
*/
static final int EXTANCHORLINKS_WRAP = 0x00800000;
/**
* Enables footnote processing [^1]: Text Paragraph with continuations
* and footnote reference [^1]
*/
static final int FOOTNOTES = 0x01000000;
/**
* Enables TOC extension
*/
static final int TOC = 0x02000000;
/**
* ![alt](.....?
*
* )
*
* ![alt](.....?
*
* "title")
*
* Enables MULTI_LINE_IMAGE_URLS extension which allows image urls of the form above.
* any text at all until ) or "title") at the begining of a line.
* Used for displaying UML diagrams with gravizo.com
*/
static final int MULTI_LINE_IMAGE_URLS = 0x04000000;
/**
* trace parsing elements to console
*/
static final int SUPERSCRIPT = 0x08000000;
/**
* Force List and Definition Paragraph wrapping if it includes more than just a single paragraph
*/
static final int FORCELISTITEMPARA = 0x10000000;
/**
* spare bits
*/
static final int NOT_USED = 0x20000000;
/**
* Enables adding a dummy reference key node to RefLink and RefImage so that the AST differs
* between [ ][] and plain [ ] for refLink and ![ ][] and plain ![ ] for RefImage
*/
static final int INSERTED = 0x40000000;
static final int UNUSABLE = 0x80000000;
/**
* All Optionals other than Suppress and FORCELISTITEMPARA which is a backwards compatibility extension
*/
static final int ALL_OPTIONALS = (ATXHEADERSPACE | RELAXEDHRULES | TASKLISTITEMS | EXTANCHORLINKS | FOOTNOTES | SUBSCRIPT | SUPERSCRIPT | TOC | MULTI_LINE_IMAGE_URLS | INSERTED);
static final int ALL_WITH_OPTIONALS = ALL | ALL_OPTIONALS;
/**
* These are GitHub main repo document processing compatibility flags
*/
static final int GITHUB_DOCUMENT_COMPATIBLE = (FENCED_CODE_BLOCKS | TABLES | AUTOLINKS | ANCHORLINKS | TASKLISTITEMS | STRIKETHROUGH | ATXHEADERSPACE | RELAXEDHRULES);
/**
* These are GitHub wiki page processing compatibility flags
*/
static final int GITHUB_WIKI_COMPATIBLE = (GITHUB_DOCUMENT_COMPATIBLE | WIKILINKS);
/**
* These are GitHub comment (issues, pull requests and comments) processing compatibility flags
*/
static final int GITHUB_COMMENT_COMPATIBLE = (GITHUB_DOCUMENT_COMPATIBLE | HARDWRAPS);
}