qiita_marker 0.23.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +50 -0
- data/Rakefile +113 -0
- data/bin/qiita_marker +123 -0
- data/ext/qiita_marker/arena.c +103 -0
- data/ext/qiita_marker/autolink.c +425 -0
- data/ext/qiita_marker/autolink.h +8 -0
- data/ext/qiita_marker/blocks.c +1596 -0
- data/ext/qiita_marker/buffer.c +278 -0
- data/ext/qiita_marker/buffer.h +116 -0
- data/ext/qiita_marker/case_fold_switch.inc +4327 -0
- data/ext/qiita_marker/chunk.h +135 -0
- data/ext/qiita_marker/cmark-gfm-core-extensions.h +54 -0
- data/ext/qiita_marker/cmark-gfm-extension_api.h +736 -0
- data/ext/qiita_marker/cmark-gfm-extensions_export.h +42 -0
- data/ext/qiita_marker/cmark-gfm.h +817 -0
- data/ext/qiita_marker/cmark-gfm_export.h +42 -0
- data/ext/qiita_marker/cmark-gfm_version.h +7 -0
- data/ext/qiita_marker/cmark.c +55 -0
- data/ext/qiita_marker/cmark_ctype.c +44 -0
- data/ext/qiita_marker/cmark_ctype.h +33 -0
- data/ext/qiita_marker/commonmark.c +529 -0
- data/ext/qiita_marker/config.h +76 -0
- data/ext/qiita_marker/core-extensions.c +27 -0
- data/ext/qiita_marker/entities.inc +2138 -0
- data/ext/qiita_marker/ext_scanners.c +879 -0
- data/ext/qiita_marker/ext_scanners.h +24 -0
- data/ext/qiita_marker/extconf.rb +7 -0
- data/ext/qiita_marker/footnotes.c +63 -0
- data/ext/qiita_marker/footnotes.h +27 -0
- data/ext/qiita_marker/houdini.h +57 -0
- data/ext/qiita_marker/houdini_href_e.c +100 -0
- data/ext/qiita_marker/houdini_html_e.c +66 -0
- data/ext/qiita_marker/houdini_html_u.c +149 -0
- data/ext/qiita_marker/html.c +486 -0
- data/ext/qiita_marker/html.h +27 -0
- data/ext/qiita_marker/inlines.c +1691 -0
- data/ext/qiita_marker/inlines.h +29 -0
- data/ext/qiita_marker/iterator.c +159 -0
- data/ext/qiita_marker/iterator.h +26 -0
- data/ext/qiita_marker/latex.c +466 -0
- data/ext/qiita_marker/linked_list.c +37 -0
- data/ext/qiita_marker/man.c +278 -0
- data/ext/qiita_marker/map.c +122 -0
- data/ext/qiita_marker/map.h +41 -0
- data/ext/qiita_marker/node.c +979 -0
- data/ext/qiita_marker/node.h +125 -0
- data/ext/qiita_marker/parser.h +58 -0
- data/ext/qiita_marker/plaintext.c +235 -0
- data/ext/qiita_marker/plugin.c +36 -0
- data/ext/qiita_marker/plugin.h +34 -0
- data/ext/qiita_marker/qiita_marker.c +1321 -0
- data/ext/qiita_marker/qiita_marker.h +16 -0
- data/ext/qiita_marker/references.c +42 -0
- data/ext/qiita_marker/references.h +26 -0
- data/ext/qiita_marker/registry.c +63 -0
- data/ext/qiita_marker/registry.h +24 -0
- data/ext/qiita_marker/render.c +205 -0
- data/ext/qiita_marker/render.h +62 -0
- data/ext/qiita_marker/scanners.c +10520 -0
- data/ext/qiita_marker/scanners.h +62 -0
- data/ext/qiita_marker/scanners.re +341 -0
- data/ext/qiita_marker/strikethrough.c +167 -0
- data/ext/qiita_marker/strikethrough.h +9 -0
- data/ext/qiita_marker/syntax_extension.c +149 -0
- data/ext/qiita_marker/syntax_extension.h +34 -0
- data/ext/qiita_marker/table.c +822 -0
- data/ext/qiita_marker/table.h +12 -0
- data/ext/qiita_marker/tagfilter.c +60 -0
- data/ext/qiita_marker/tagfilter.h +8 -0
- data/ext/qiita_marker/tasklist.c +156 -0
- data/ext/qiita_marker/tasklist.h +8 -0
- data/ext/qiita_marker/utf8.c +317 -0
- data/ext/qiita_marker/utf8.h +35 -0
- data/ext/qiita_marker/xml.c +181 -0
- data/lib/qiita_marker/config.rb +52 -0
- data/lib/qiita_marker/node/inspect.rb +57 -0
- data/lib/qiita_marker/node.rb +83 -0
- data/lib/qiita_marker/renderer/html_renderer.rb +252 -0
- data/lib/qiita_marker/renderer.rb +135 -0
- data/lib/qiita_marker/version.rb +5 -0
- data/lib/qiita_marker.rb +45 -0
- data/qiita_marker.gemspec +40 -0
- data/test/benchmark.rb +32 -0
- data/test/fixtures/curly.md +1 -0
- data/test/fixtures/dingus.md +10 -0
- data/test/fixtures/strong.md +1 -0
- data/test/fixtures/table.md +10 -0
- data/test/test_attributes.rb +24 -0
- data/test/test_basics.rb +35 -0
- data/test/test_commands.rb +72 -0
- data/test/test_commonmark.rb +36 -0
- data/test/test_doc.rb +130 -0
- data/test/test_encoding.rb +23 -0
- data/test/test_extensions.rb +116 -0
- data/test/test_footnotes.rb +60 -0
- data/test/test_gc.rb +47 -0
- data/test/test_helper.rb +71 -0
- data/test/test_linebreaks.rb +15 -0
- data/test/test_maliciousness.rb +262 -0
- data/test/test_node.rb +89 -0
- data/test/test_options.rb +37 -0
- data/test/test_pathological_inputs.rb +94 -0
- data/test/test_plaintext.rb +46 -0
- data/test/test_renderer.rb +47 -0
- data/test/test_smartpunct.rb +27 -0
- data/test/test_spec.rb +30 -0
- data/test/test_tasklists.rb +43 -0
- data/test/test_xml.rb +107 -0
- metadata +313 -0
@@ -0,0 +1,76 @@
|
|
1
|
+
#ifndef CMARK_CONFIG_H
|
2
|
+
#define CMARK_CONFIG_H
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
#define HAVE_STDBOOL_H
|
9
|
+
|
10
|
+
#ifdef HAVE_STDBOOL_H
|
11
|
+
#include <stdbool.h>
|
12
|
+
#elif !defined(__cplusplus)
|
13
|
+
typedef char bool;
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#define HAVE___BUILTIN_EXPECT
|
17
|
+
|
18
|
+
#define HAVE___ATTRIBUTE__
|
19
|
+
|
20
|
+
#ifdef HAVE___ATTRIBUTE__
|
21
|
+
#define CMARK_ATTRIBUTE(list) __attribute__ (list)
|
22
|
+
#else
|
23
|
+
#define CMARK_ATTRIBUTE(list)
|
24
|
+
#endif
|
25
|
+
|
26
|
+
#ifndef CMARK_INLINE
|
27
|
+
#if defined(_MSC_VER) && !defined(__cplusplus)
|
28
|
+
#define CMARK_INLINE __inline
|
29
|
+
#else
|
30
|
+
#define CMARK_INLINE inline
|
31
|
+
#endif
|
32
|
+
#endif
|
33
|
+
|
34
|
+
/* snprintf and vsnprintf fallbacks for MSVC before 2015,
|
35
|
+
due to Valentin Milea http://stackoverflow.com/questions/2915672/
|
36
|
+
*/
|
37
|
+
|
38
|
+
#if defined(_MSC_VER) && _MSC_VER < 1900
|
39
|
+
|
40
|
+
#include <stdio.h>
|
41
|
+
#include <stdarg.h>
|
42
|
+
|
43
|
+
#define snprintf c99_snprintf
|
44
|
+
#define vsnprintf c99_vsnprintf
|
45
|
+
|
46
|
+
CMARK_INLINE int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
|
47
|
+
{
|
48
|
+
int count = -1;
|
49
|
+
|
50
|
+
if (size != 0)
|
51
|
+
count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);
|
52
|
+
if (count == -1)
|
53
|
+
count = _vscprintf(format, ap);
|
54
|
+
|
55
|
+
return count;
|
56
|
+
}
|
57
|
+
|
58
|
+
CMARK_INLINE int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
|
59
|
+
{
|
60
|
+
int count;
|
61
|
+
va_list ap;
|
62
|
+
|
63
|
+
va_start(ap, format);
|
64
|
+
count = c99_vsnprintf(outBuf, size, format, ap);
|
65
|
+
va_end(ap);
|
66
|
+
|
67
|
+
return count;
|
68
|
+
}
|
69
|
+
|
70
|
+
#endif
|
71
|
+
|
72
|
+
#ifdef __cplusplus
|
73
|
+
}
|
74
|
+
#endif
|
75
|
+
|
76
|
+
#endif
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#include "cmark-gfm-core-extensions.h"
|
2
|
+
#include "autolink.h"
|
3
|
+
#include "strikethrough.h"
|
4
|
+
#include "table.h"
|
5
|
+
#include "tagfilter.h"
|
6
|
+
#include "tasklist.h"
|
7
|
+
#include "registry.h"
|
8
|
+
#include "plugin.h"
|
9
|
+
|
10
|
+
static int core_extensions_registration(cmark_plugin *plugin) {
|
11
|
+
cmark_plugin_register_syntax_extension(plugin, create_table_extension());
|
12
|
+
cmark_plugin_register_syntax_extension(plugin,
|
13
|
+
create_strikethrough_extension());
|
14
|
+
cmark_plugin_register_syntax_extension(plugin, create_autolink_extension());
|
15
|
+
cmark_plugin_register_syntax_extension(plugin, create_tagfilter_extension());
|
16
|
+
cmark_plugin_register_syntax_extension(plugin, create_tasklist_extension());
|
17
|
+
return 1;
|
18
|
+
}
|
19
|
+
|
20
|
+
void cmark_gfm_core_extensions_ensure_registered(void) {
|
21
|
+
static int registered = 0;
|
22
|
+
|
23
|
+
if (!registered) {
|
24
|
+
cmark_register_plugin(core_extensions_registration);
|
25
|
+
registered = 1;
|
26
|
+
}
|
27
|
+
}
|