commonmarker 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of commonmarker might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +3 -0
- data/bin/commonmarker +19 -3
- data/ext/commonmarker/cmark/CMakeLists.txt +1 -0
- data/ext/commonmarker/cmark/COPYING +2 -24
- data/ext/commonmarker/cmark/Makefile +25 -5
- data/ext/commonmarker/cmark/README.md +1 -1
- data/ext/commonmarker/cmark/api_test/CMakeLists.txt +1 -1
- data/ext/commonmarker/cmark/api_test/main.c +25 -27
- data/ext/commonmarker/cmark/build/CMakeCache.txt +12 -9
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeCCompiler.cmake +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeCXXCompiler.cmake +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeDetermineCompilerABI_C.bin +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeDetermineCompilerABI_CXX.bin +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeSystem.cmake +4 -4
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdC/CMakeCCompilerId.c +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdC/a.out +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdCXX/a.out +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/CMakeError.log +6 -6
- data/ext/commonmarker/cmark/build/CMakeFiles/CMakeOutput.log +148 -148
- data/ext/commonmarker/cmark/build/CMakeFiles/Makefile.cmake +41 -109
- data/ext/commonmarker/cmark/build/CMakeFiles/Makefile2 +66 -10
- data/ext/commonmarker/cmark/build/CMakeFiles/TargetDirectories.txt +8 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/progress.marks +1 -1
- data/ext/commonmarker/cmark/build/CTestTestfile.cmake +1 -0
- data/ext/commonmarker/cmark/build/Makefile +23 -9
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/build.make +2 -2
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/progress.marks +1 -1
- data/ext/commonmarker/cmark/build/api_test/Makefile +9 -9
- data/ext/commonmarker/cmark/build/cmake_install.cmake +1 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/C.includecache +190 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/DependInfo.cmake +29 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/autolink.c.o +0 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/build.make +249 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/cmake_clean.cmake +15 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/cmake_clean_target.cmake +3 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/core-extensions.c.o +0 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/depend.internal +92 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/depend.make +92 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/ext_scanners.c.o +0 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/flags.make +10 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/link.txt +2 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/progress.make +8 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/strikethrough.c.o +0 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/table.c.o +0 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/whitelist.c.o +0 -0
- data/ext/commonmarker/cmark/build/extensions/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark/build/extensions/Makefile +390 -0
- data/ext/commonmarker/cmark/build/extensions/cmake_install.cmake +29 -0
- data/ext/commonmarker/cmark/build/extensions/libcmarkextensions.a +0 -0
- data/ext/commonmarker/cmark/build/man/Makefile +9 -9
- data/ext/commonmarker/cmark/build/src/CMakeFiles/Export/lib/cmake/cmark.cmake +1 -1
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/DependInfo.cmake +7 -19
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/build.make +6 -517
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmake_clean.cmake +0 -19
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/flags.make +1 -1
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/link.txt +1 -1
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/progress.make +0 -19
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/DependInfo.cmake +9 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/build.make +112 -4
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmake_clean.cmake +4 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/flags.make +1 -1
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/link.txt +1 -1
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/progress.make +24 -20
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/C.includecache +144 -10
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/DependInfo.cmake +9 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/blocks.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/build.make +112 -4
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean.cmake +4 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/commonmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.internal +74 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.make +74 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/flags.make +1 -1
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/html.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/inlines.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/iterator.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/latex.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/link.txt +1 -1
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/linked_list.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/man.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/node.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/plugin.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/progress.make +24 -20
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/registry.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/scanners.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/syntax_extension.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/xml.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/progress.marks +1 -1
- data/ext/commonmarker/cmark/build/src/Makefile +141 -66
- data/ext/commonmarker/cmark/build/src/cmake_install.cmake +4 -0
- data/ext/commonmarker/cmark/build/src/libcmark.a +0 -0
- data/ext/commonmarker/cmark/build/testdir/CTestTestfile.cmake +3 -1
- data/ext/commonmarker/cmark/build/testdir/Makefile +9 -9
- data/ext/commonmarker/cmark/extensions/CMakeLists.txt +82 -0
- data/ext/commonmarker/cmark/extensions/autolink.c +338 -0
- data/ext/commonmarker/cmark/extensions/autolink.h +8 -0
- data/ext/commonmarker/cmark/extensions/core-extensions.c +16 -0
- data/ext/commonmarker/cmark/extensions/core-extensions.h +16 -0
- data/ext/commonmarker/cmark/extensions/ext_scanners.c +585 -0
- data/ext/commonmarker/cmark/extensions/ext_scanners.h +20 -0
- data/ext/commonmarker/cmark/extensions/ext_scanners.re +65 -0
- data/ext/commonmarker/cmark/extensions/strikethrough.c +142 -0
- data/ext/commonmarker/cmark/extensions/strikethrough.h +9 -0
- data/ext/commonmarker/cmark/extensions/table.c +493 -0
- data/ext/commonmarker/cmark/extensions/table.h +8 -0
- data/ext/commonmarker/cmark/extensions/whitelist.c +59 -0
- data/ext/commonmarker/cmark/extensions/whitelist.h +8 -0
- data/ext/commonmarker/cmark/man/man3/cmark.3 +98 -34
- data/ext/commonmarker/cmark/src/CMakeLists.txt +16 -1
- data/ext/commonmarker/cmark/src/blocks.c +219 -40
- data/ext/commonmarker/cmark/src/buffer.h +36 -0
- data/ext/commonmarker/cmark/src/cmark.c +5 -1
- data/ext/commonmarker/cmark/src/cmark.h +91 -34
- data/ext/commonmarker/cmark/src/cmark_ctype.h +7 -0
- data/ext/commonmarker/cmark/src/cmark_extension_api.h +655 -0
- data/ext/commonmarker/cmark/src/commonmark.c +7 -2
- data/ext/commonmarker/cmark/src/houdini.h +12 -6
- data/ext/commonmarker/cmark/src/houdini_html_e.c +1 -1
- data/ext/commonmarker/cmark/src/html.c +102 -54
- data/ext/commonmarker/cmark/src/html.h +27 -0
- data/ext/commonmarker/cmark/src/inlines.c +261 -53
- data/ext/commonmarker/cmark/src/inlines.h +7 -2
- data/ext/commonmarker/cmark/src/iterator.c +12 -7
- data/ext/commonmarker/cmark/src/latex.c +5 -2
- data/ext/commonmarker/cmark/src/linked_list.c +37 -0
- data/ext/commonmarker/cmark/src/main.c +91 -27
- data/ext/commonmarker/cmark/src/man.c +18 -2
- data/ext/commonmarker/cmark/src/node.c +157 -58
- data/ext/commonmarker/cmark/src/node.h +23 -0
- data/ext/commonmarker/cmark/src/parser.h +19 -2
- data/ext/commonmarker/cmark/src/plugin.c +33 -0
- data/ext/commonmarker/cmark/src/plugin.h +34 -0
- data/ext/commonmarker/cmark/src/registry.c +60 -0
- data/ext/commonmarker/cmark/src/registry.h +24 -0
- data/ext/commonmarker/cmark/src/render.h +9 -0
- data/ext/commonmarker/cmark/src/scanners.c +265 -391
- data/ext/commonmarker/cmark/src/scanners.h +5 -0
- data/ext/commonmarker/cmark/src/scanners.re +2 -2
- data/ext/commonmarker/cmark/src/syntax_extension.c +110 -0
- data/ext/commonmarker/cmark/src/syntax_extension.h +27 -0
- data/ext/commonmarker/cmark/suppressions +28 -0
- data/ext/commonmarker/cmark/test/CMakeLists.txt +12 -1
- data/ext/commonmarker/cmark/test/extensions.txt +173 -0
- data/ext/commonmarker/cmark/test/regression.txt +24 -0
- data/ext/commonmarker/cmark/test/spec.txt +27 -26
- data/ext/commonmarker/cmark/toolchain-mingw32.cmake +1 -1
- data/ext/commonmarker/commonmarker.c +132 -15
- data/ext/commonmarker/commonmarker.h +4 -0
- data/ext/commonmarker/extconf.rb +12 -5
- data/lib/commonmarker.rb +8 -6
- data/lib/commonmarker/node.rb +13 -2
- data/lib/commonmarker/renderer.rb +1 -1
- data/lib/commonmarker/version.rb +1 -1
- data/test/test_commonmark.rb +34 -0
- data/test/test_encoding.rb +2 -1
- data/test/test_extensions.rb +50 -0
- data/test/test_helper.rb +2 -1
- metadata +65 -11
@@ -9,6 +9,7 @@ extern "C" {
|
|
9
9
|
#include <stdint.h>
|
10
10
|
|
11
11
|
#include "cmark.h"
|
12
|
+
#include "cmark_extension_api.h"
|
12
13
|
#include "buffer.h"
|
13
14
|
#include "chunk.h"
|
14
15
|
|
@@ -61,6 +62,7 @@ struct cmark_node {
|
|
61
62
|
struct cmark_node *last_child;
|
62
63
|
|
63
64
|
void *user_data;
|
65
|
+
cmark_free_func user_data_free_func;
|
64
66
|
|
65
67
|
int start_line;
|
66
68
|
int start_column;
|
@@ -69,6 +71,8 @@ struct cmark_node {
|
|
69
71
|
uint16_t type;
|
70
72
|
uint16_t flags;
|
71
73
|
|
74
|
+
cmark_syntax_extension *extension;
|
75
|
+
|
72
76
|
union {
|
73
77
|
cmark_chunk literal;
|
74
78
|
cmark_list list;
|
@@ -77,6 +81,7 @@ struct cmark_node {
|
|
77
81
|
cmark_link link;
|
78
82
|
cmark_custom custom;
|
79
83
|
int html_block_type;
|
84
|
+
void *opaque;
|
80
85
|
} as;
|
81
86
|
};
|
82
87
|
|
@@ -85,6 +90,24 @@ static CMARK_INLINE cmark_mem *cmark_node_mem(cmark_node *node) {
|
|
85
90
|
}
|
86
91
|
CMARK_EXPORT int cmark_node_check(cmark_node *node, FILE *out);
|
87
92
|
|
93
|
+
static CMARK_INLINE bool CMARK_NODE_TYPE_BLOCK_P(cmark_node_type node_type) {
|
94
|
+
return (node_type & CMARK_NODE_TYPE_MASK) == CMARK_NODE_TYPE_BLOCK;
|
95
|
+
}
|
96
|
+
|
97
|
+
static CMARK_INLINE bool CMARK_NODE_BLOCK_P(cmark_node *node) {
|
98
|
+
return node != NULL && CMARK_NODE_TYPE_BLOCK_P((cmark_node_type) node->type);
|
99
|
+
}
|
100
|
+
|
101
|
+
static CMARK_INLINE bool CMARK_NODE_TYPE_INLINE_P(cmark_node_type node_type) {
|
102
|
+
return (node_type & CMARK_NODE_TYPE_MASK) == CMARK_NODE_TYPE_INLINE;
|
103
|
+
}
|
104
|
+
|
105
|
+
static CMARK_INLINE bool CMARK_NODE_INLINE_P(cmark_node *node) {
|
106
|
+
return node != NULL && CMARK_NODE_TYPE_INLINE_P((cmark_node_type) node->type);
|
107
|
+
}
|
108
|
+
|
109
|
+
CMARK_EXPORT bool cmark_node_can_contain_type(cmark_node *node, cmark_node_type child_type);
|
110
|
+
|
88
111
|
#ifdef __cplusplus
|
89
112
|
}
|
90
113
|
#endif
|
@@ -1,5 +1,5 @@
|
|
1
|
-
#ifndef
|
2
|
-
#define
|
1
|
+
#ifndef CMARK_PARSER_H
|
2
|
+
#define CMARK_PARSER_H
|
3
3
|
|
4
4
|
#include <stdio.h>
|
5
5
|
#include "node.h"
|
@@ -14,22 +14,39 @@ extern "C" {
|
|
14
14
|
|
15
15
|
struct cmark_parser {
|
16
16
|
struct cmark_mem *mem;
|
17
|
+
/* A hashtable of urls in the current document for cross-references */
|
17
18
|
struct cmark_reference_map *refmap;
|
19
|
+
/* The root node of the parser, always a CMARK_NODE_DOCUMENT */
|
18
20
|
struct cmark_node *root;
|
21
|
+
/* The last open block after a line is fully processed */
|
19
22
|
struct cmark_node *current;
|
23
|
+
/* See the documentation for cmark_parser_get_line_number() in cmark.h */
|
20
24
|
int line_number;
|
25
|
+
/* See the documentation for cmark_parser_get_offset() in cmark.h */
|
21
26
|
bufsize_t offset;
|
27
|
+
/* See the documentation for cmark_parser_get_column() in cmark.h */
|
22
28
|
bufsize_t column;
|
29
|
+
/* See the documentation for cmark_parser_get_first_nonspace() in cmark.h */
|
23
30
|
bufsize_t first_nonspace;
|
31
|
+
/* See the documentation for cmark_parser_get_first_nonspace_column() in cmark.h */
|
24
32
|
bufsize_t first_nonspace_column;
|
33
|
+
/* See the documentation for cmark_parser_get_indent() in cmark.h */
|
25
34
|
int indent;
|
35
|
+
/* See the documentation for cmark_parser_is_blank() in cmark.h */
|
26
36
|
bool blank;
|
37
|
+
/* See the documentation for cmark_parser_has_partially_consumed_tab() in cmark.h */
|
27
38
|
bool partially_consumed_tab;
|
39
|
+
/* Contains the currently processed line */
|
28
40
|
cmark_strbuf curline;
|
41
|
+
/* See the documentation for cmark_parser_get_last_line_length() in cmark.h */
|
29
42
|
bufsize_t last_line_length;
|
43
|
+
/* FIXME: not sure about the difference with curline */
|
30
44
|
cmark_strbuf linebuf;
|
45
|
+
/* Options set by the user, see the Options section in cmark.h */
|
31
46
|
int options;
|
32
47
|
bool last_buffer_ended_with_cr;
|
48
|
+
cmark_llist *syntax_extensions;
|
49
|
+
cmark_llist *inline_syntax_extensions;
|
33
50
|
};
|
34
51
|
|
35
52
|
#ifdef __cplusplus
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#include <stdlib.h>
|
2
|
+
|
3
|
+
#include "plugin.h"
|
4
|
+
|
5
|
+
int cmark_plugin_register_syntax_extension(cmark_plugin * plugin,
|
6
|
+
cmark_syntax_extension * extension) {
|
7
|
+
plugin->syntax_extensions = cmark_llist_append(plugin->syntax_extensions, extension);
|
8
|
+
return 1;
|
9
|
+
}
|
10
|
+
|
11
|
+
cmark_plugin *
|
12
|
+
cmark_plugin_new(void) {
|
13
|
+
cmark_plugin *res = (cmark_plugin *) malloc(sizeof(cmark_plugin));
|
14
|
+
|
15
|
+
res->syntax_extensions = NULL;
|
16
|
+
|
17
|
+
return res;
|
18
|
+
}
|
19
|
+
|
20
|
+
void
|
21
|
+
cmark_plugin_free(cmark_plugin *plugin) {
|
22
|
+
cmark_llist_free_full(plugin->syntax_extensions,
|
23
|
+
(cmark_free_func) cmark_syntax_extension_free);
|
24
|
+
free(plugin);
|
25
|
+
}
|
26
|
+
|
27
|
+
cmark_llist *
|
28
|
+
cmark_plugin_steal_syntax_extensions(cmark_plugin *plugin) {
|
29
|
+
cmark_llist *res = plugin->syntax_extensions;
|
30
|
+
|
31
|
+
plugin->syntax_extensions = NULL;
|
32
|
+
return res;
|
33
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#ifndef CMARK_PLUGIN_H
|
2
|
+
#define CMARK_PLUGIN_H
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
#include "cmark.h"
|
9
|
+
#include "cmark_extension_api.h"
|
10
|
+
|
11
|
+
/**
|
12
|
+
* cmark_plugin:
|
13
|
+
*
|
14
|
+
* A plugin structure, which should be filled by plugin's
|
15
|
+
* init functions.
|
16
|
+
*/
|
17
|
+
struct cmark_plugin {
|
18
|
+
cmark_llist *syntax_extensions;
|
19
|
+
};
|
20
|
+
|
21
|
+
cmark_llist *
|
22
|
+
cmark_plugin_steal_syntax_extensions(cmark_plugin *plugin);
|
23
|
+
|
24
|
+
cmark_plugin *
|
25
|
+
cmark_plugin_new(void);
|
26
|
+
|
27
|
+
void
|
28
|
+
cmark_plugin_free(cmark_plugin *plugin);
|
29
|
+
|
30
|
+
#ifdef __cplusplus
|
31
|
+
}
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#endif
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#include <stdint.h>
|
2
|
+
#include <stdlib.h>
|
3
|
+
#include <string.h>
|
4
|
+
|
5
|
+
#include "config.h"
|
6
|
+
#include "cmark.h"
|
7
|
+
#include "syntax_extension.h"
|
8
|
+
#include "registry.h"
|
9
|
+
#include "plugin.h"
|
10
|
+
|
11
|
+
|
12
|
+
static cmark_llist *syntax_extensions = NULL;
|
13
|
+
|
14
|
+
void cmark_register_plugin(cmark_plugin_init_func reg_fn) {
|
15
|
+
cmark_plugin *plugin = cmark_plugin_new();
|
16
|
+
|
17
|
+
if (!reg_fn(plugin)) {
|
18
|
+
cmark_plugin_free(plugin);
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
|
22
|
+
cmark_llist *syntax_extensions_list = cmark_plugin_steal_syntax_extensions(plugin),
|
23
|
+
*it;
|
24
|
+
|
25
|
+
for (it = syntax_extensions_list; it; it = it->next) {
|
26
|
+
syntax_extensions = cmark_llist_append(syntax_extensions, it->data);
|
27
|
+
}
|
28
|
+
|
29
|
+
cmark_llist_free(syntax_extensions_list);
|
30
|
+
cmark_plugin_free(plugin);
|
31
|
+
}
|
32
|
+
|
33
|
+
void cmark_release_plugins(void) {
|
34
|
+
if (syntax_extensions) {
|
35
|
+
cmark_llist_free_full(syntax_extensions,
|
36
|
+
(cmark_free_func) cmark_syntax_extension_free);
|
37
|
+
syntax_extensions = NULL;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
cmark_llist *cmark_list_syntax_extensions(void) {
|
42
|
+
cmark_llist *it;
|
43
|
+
cmark_llist *res = NULL;
|
44
|
+
|
45
|
+
for (it = syntax_extensions; it; it = it->next) {
|
46
|
+
res = cmark_llist_append(res, it->data);
|
47
|
+
}
|
48
|
+
return res;
|
49
|
+
}
|
50
|
+
|
51
|
+
cmark_syntax_extension *cmark_find_syntax_extension(const char *name) {
|
52
|
+
cmark_llist *tmp;
|
53
|
+
|
54
|
+
for (tmp = syntax_extensions; tmp; tmp = tmp->next) {
|
55
|
+
cmark_syntax_extension *ext = (cmark_syntax_extension *) tmp->data;
|
56
|
+
if (!strcmp(ext->name, name))
|
57
|
+
return ext;
|
58
|
+
}
|
59
|
+
return NULL;
|
60
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#ifndef CMARK_REGISTRY_H
|
2
|
+
#define CMARK_REGISTRY_H
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
#include "cmark.h"
|
9
|
+
#include "plugin.h"
|
10
|
+
|
11
|
+
CMARK_EXPORT
|
12
|
+
void cmark_register_plugin(cmark_plugin_init_func reg_fn);
|
13
|
+
|
14
|
+
CMARK_EXPORT
|
15
|
+
void cmark_release_plugins(void);
|
16
|
+
|
17
|
+
CMARK_EXPORT
|
18
|
+
cmark_llist *cmark_list_syntax_extensions(void);
|
19
|
+
|
20
|
+
#ifdef __cplusplus
|
21
|
+
}
|
22
|
+
#endif
|
23
|
+
|
24
|
+
#endif
|
@@ -32,6 +32,15 @@ struct cmark_renderer {
|
|
32
32
|
|
33
33
|
typedef struct cmark_renderer cmark_renderer;
|
34
34
|
|
35
|
+
struct cmark_html_renderer {
|
36
|
+
cmark_strbuf *html;
|
37
|
+
cmark_node *plain;
|
38
|
+
cmark_llist *filter_extensions;
|
39
|
+
void *opaque;
|
40
|
+
};
|
41
|
+
|
42
|
+
typedef struct cmark_html_renderer cmark_html_renderer;
|
43
|
+
|
35
44
|
void cmark_render_ascii(cmark_renderer *renderer, const char *s);
|
36
45
|
|
37
46
|
void cmark_render_code_point(cmark_renderer *renderer, uint32_t c);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* Generated by re2c 0.15.3 */
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include "chunk.h"
|
4
2
|
#include "scanners.h"
|
3
|
+
#include "chunk.h"
|
4
|
+
#include <stdlib.h>
|
5
5
|
|
6
6
|
bufsize_t _scan_at(bufsize_t (*scanner)(const unsigned char *), cmark_chunk *c,
|
7
7
|
bufsize_t offset) {
|
@@ -29,38 +29,30 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
29
29
|
{
|
30
30
|
unsigned char yych;
|
31
31
|
yych = *(marker = p);
|
32
|
-
if (yych <=
|
33
|
-
if (yych <= '
|
32
|
+
if (yych <= 0xC1) {
|
33
|
+
if (yych <= 'Z') {
|
34
34
|
if (yych == '\n')
|
35
35
|
goto yy2;
|
36
|
-
if (yych <=
|
36
|
+
if (yych <= '@')
|
37
37
|
goto yy4;
|
38
38
|
goto yy3;
|
39
39
|
} else {
|
40
|
-
if (yych <= '
|
41
|
-
|
42
|
-
|
40
|
+
if (yych <= '`')
|
41
|
+
goto yy4;
|
42
|
+
if (yych <= 'z')
|
43
43
|
goto yy3;
|
44
|
-
|
45
|
-
if (yych <= '`')
|
46
|
-
goto yy4;
|
47
|
-
if (yych <= 'z')
|
48
|
-
goto yy3;
|
44
|
+
if (yych <= 0x7F)
|
49
45
|
goto yy4;
|
50
|
-
}
|
51
46
|
}
|
52
47
|
} else {
|
53
48
|
if (yych <= 0xED) {
|
54
|
-
if (yych <= 0xDF)
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
goto yy8;
|
62
|
-
goto yy12;
|
63
|
-
}
|
49
|
+
if (yych <= 0xDF)
|
50
|
+
goto yy5;
|
51
|
+
if (yych <= 0xE0)
|
52
|
+
goto yy7;
|
53
|
+
if (yych <= 0xEC)
|
54
|
+
goto yy8;
|
55
|
+
goto yy12;
|
64
56
|
} else {
|
65
57
|
if (yych <= 0xF0) {
|
66
58
|
if (yych <= 0xEF)
|
@@ -77,14 +69,22 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
77
69
|
yy2 : { return 0; }
|
78
70
|
yy3:
|
79
71
|
yych = *(marker = ++p);
|
80
|
-
if (yych <= '
|
81
|
-
if (yych
|
72
|
+
if (yych <= '/') {
|
73
|
+
if (yych <= '+') {
|
74
|
+
if (yych <= '*')
|
75
|
+
goto yy2;
|
82
76
|
goto yy13;
|
83
|
-
|
77
|
+
} else {
|
78
|
+
if (yych <= ',')
|
79
|
+
goto yy2;
|
80
|
+
if (yych <= '.')
|
81
|
+
goto yy13;
|
84
82
|
goto yy2;
|
85
|
-
|
83
|
+
}
|
86
84
|
} else {
|
87
85
|
if (yych <= 'Z') {
|
86
|
+
if (yych <= '9')
|
87
|
+
goto yy13;
|
88
88
|
if (yych <= '@')
|
89
89
|
goto yy2;
|
90
90
|
goto yy13;
|
@@ -153,16 +153,14 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
153
153
|
yy13:
|
154
154
|
yych = *++p;
|
155
155
|
if (yych <= '9') {
|
156
|
-
if (yych <= '
|
157
|
-
if (yych
|
158
|
-
goto yy6;
|
159
|
-
goto yy16;
|
160
|
-
} else {
|
161
|
-
if (yych <= ',')
|
162
|
-
goto yy6;
|
163
|
-
if (yych <= '.')
|
156
|
+
if (yych <= ',') {
|
157
|
+
if (yych == '+')
|
164
158
|
goto yy16;
|
165
159
|
goto yy6;
|
160
|
+
} else {
|
161
|
+
if (yych == '/')
|
162
|
+
goto yy6;
|
163
|
+
goto yy16;
|
166
164
|
}
|
167
165
|
} else {
|
168
166
|
if (yych <= 'Z') {
|
@@ -185,13 +183,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
185
183
|
yy16:
|
186
184
|
yych = *++p;
|
187
185
|
if (yych <= '9') {
|
188
|
-
if (yych <= '
|
189
|
-
if (yych
|
186
|
+
if (yych <= ',') {
|
187
|
+
if (yych != '+')
|
190
188
|
goto yy6;
|
191
189
|
} else {
|
192
|
-
if (yych
|
193
|
-
goto yy6;
|
194
|
-
if (yych >= '/')
|
190
|
+
if (yych == '/')
|
195
191
|
goto yy6;
|
196
192
|
}
|
197
193
|
} else {
|
@@ -209,13 +205,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
209
205
|
}
|
210
206
|
yych = *++p;
|
211
207
|
if (yych <= '9') {
|
212
|
-
if (yych <= '
|
213
|
-
if (yych
|
208
|
+
if (yych <= ',') {
|
209
|
+
if (yych != '+')
|
214
210
|
goto yy6;
|
215
211
|
} else {
|
216
|
-
if (yych
|
217
|
-
goto yy6;
|
218
|
-
if (yych >= '/')
|
212
|
+
if (yych == '/')
|
219
213
|
goto yy6;
|
220
214
|
}
|
221
215
|
} else {
|
@@ -233,13 +227,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
233
227
|
}
|
234
228
|
yych = *++p;
|
235
229
|
if (yych <= '9') {
|
236
|
-
if (yych <= '
|
237
|
-
if (yych
|
230
|
+
if (yych <= ',') {
|
231
|
+
if (yych != '+')
|
238
232
|
goto yy6;
|
239
233
|
} else {
|
240
|
-
if (yych
|
241
|
-
goto yy6;
|
242
|
-
if (yych >= '/')
|
234
|
+
if (yych == '/')
|
243
235
|
goto yy6;
|
244
236
|
}
|
245
237
|
} else {
|
@@ -257,13 +249,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
257
249
|
}
|
258
250
|
yych = *++p;
|
259
251
|
if (yych <= '9') {
|
260
|
-
if (yych <= '
|
261
|
-
if (yych
|
252
|
+
if (yych <= ',') {
|
253
|
+
if (yych != '+')
|
262
254
|
goto yy6;
|
263
255
|
} else {
|
264
|
-
if (yych
|
265
|
-
goto yy6;
|
266
|
-
if (yych >= '/')
|
256
|
+
if (yych == '/')
|
267
257
|
goto yy6;
|
268
258
|
}
|
269
259
|
} else {
|
@@ -281,13 +271,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
281
271
|
}
|
282
272
|
yych = *++p;
|
283
273
|
if (yych <= '9') {
|
284
|
-
if (yych <= '
|
285
|
-
if (yych
|
274
|
+
if (yych <= ',') {
|
275
|
+
if (yych != '+')
|
286
276
|
goto yy6;
|
287
277
|
} else {
|
288
|
-
if (yych
|
289
|
-
goto yy6;
|
290
|
-
if (yych >= '/')
|
278
|
+
if (yych == '/')
|
291
279
|
goto yy6;
|
292
280
|
}
|
293
281
|
} else {
|
@@ -305,13 +293,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
305
293
|
}
|
306
294
|
yych = *++p;
|
307
295
|
if (yych <= '9') {
|
308
|
-
if (yych <= '
|
309
|
-
if (yych
|
296
|
+
if (yych <= ',') {
|
297
|
+
if (yych != '+')
|
310
298
|
goto yy6;
|
311
299
|
} else {
|
312
|
-
if (yych
|
313
|
-
goto yy6;
|
314
|
-
if (yych >= '/')
|
300
|
+
if (yych == '/')
|
315
301
|
goto yy6;
|
316
302
|
}
|
317
303
|
} else {
|
@@ -329,13 +315,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
329
315
|
}
|
330
316
|
yych = *++p;
|
331
317
|
if (yych <= '9') {
|
332
|
-
if (yych <= '
|
333
|
-
if (yych
|
318
|
+
if (yych <= ',') {
|
319
|
+
if (yych != '+')
|
334
320
|
goto yy6;
|
335
321
|
} else {
|
336
|
-
if (yych
|
337
|
-
goto yy6;
|
338
|
-
if (yych >= '/')
|
322
|
+
if (yych == '/')
|
339
323
|
goto yy6;
|
340
324
|
}
|
341
325
|
} else {
|
@@ -353,13 +337,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
353
337
|
}
|
354
338
|
yych = *++p;
|
355
339
|
if (yych <= '9') {
|
356
|
-
if (yych <= '
|
357
|
-
if (yych
|
340
|
+
if (yych <= ',') {
|
341
|
+
if (yych != '+')
|
358
342
|
goto yy6;
|
359
343
|
} else {
|
360
|
-
if (yych
|
361
|
-
goto yy6;
|
362
|
-
if (yych >= '/')
|
344
|
+
if (yych == '/')
|
363
345
|
goto yy6;
|
364
346
|
}
|
365
347
|
} else {
|
@@ -377,13 +359,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
377
359
|
}
|
378
360
|
yych = *++p;
|
379
361
|
if (yych <= '9') {
|
380
|
-
if (yych <= '
|
381
|
-
if (yych
|
362
|
+
if (yych <= ',') {
|
363
|
+
if (yych != '+')
|
382
364
|
goto yy6;
|
383
365
|
} else {
|
384
|
-
if (yych
|
385
|
-
goto yy6;
|
386
|
-
if (yych >= '/')
|
366
|
+
if (yych == '/')
|
387
367
|
goto yy6;
|
388
368
|
}
|
389
369
|
} else {
|
@@ -401,13 +381,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
401
381
|
}
|
402
382
|
yych = *++p;
|
403
383
|
if (yych <= '9') {
|
404
|
-
if (yych <= '
|
405
|
-
if (yych
|
384
|
+
if (yych <= ',') {
|
385
|
+
if (yych != '+')
|
406
386
|
goto yy6;
|
407
387
|
} else {
|
408
|
-
if (yych
|
409
|
-
goto yy6;
|
410
|
-
if (yych >= '/')
|
388
|
+
if (yych == '/')
|
411
389
|
goto yy6;
|
412
390
|
}
|
413
391
|
} else {
|
@@ -425,13 +403,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
425
403
|
}
|
426
404
|
yych = *++p;
|
427
405
|
if (yych <= '9') {
|
428
|
-
if (yych <= '
|
429
|
-
if (yych
|
406
|
+
if (yych <= ',') {
|
407
|
+
if (yych != '+')
|
430
408
|
goto yy6;
|
431
409
|
} else {
|
432
|
-
if (yych
|
433
|
-
goto yy6;
|
434
|
-
if (yych >= '/')
|
410
|
+
if (yych == '/')
|
435
411
|
goto yy6;
|
436
412
|
}
|
437
413
|
} else {
|
@@ -449,13 +425,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
449
425
|
}
|
450
426
|
yych = *++p;
|
451
427
|
if (yych <= '9') {
|
452
|
-
if (yych <= '
|
453
|
-
if (yych
|
428
|
+
if (yych <= ',') {
|
429
|
+
if (yych != '+')
|
454
430
|
goto yy6;
|
455
431
|
} else {
|
456
|
-
if (yych
|
457
|
-
goto yy6;
|
458
|
-
if (yych >= '/')
|
432
|
+
if (yych == '/')
|
459
433
|
goto yy6;
|
460
434
|
}
|
461
435
|
} else {
|
@@ -473,13 +447,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
473
447
|
}
|
474
448
|
yych = *++p;
|
475
449
|
if (yych <= '9') {
|
476
|
-
if (yych <= '
|
477
|
-
if (yych
|
450
|
+
if (yych <= ',') {
|
451
|
+
if (yych != '+')
|
478
452
|
goto yy6;
|
479
453
|
} else {
|
480
|
-
if (yych
|
481
|
-
goto yy6;
|
482
|
-
if (yych >= '/')
|
454
|
+
if (yych == '/')
|
483
455
|
goto yy6;
|
484
456
|
}
|
485
457
|
} else {
|
@@ -497,13 +469,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
497
469
|
}
|
498
470
|
yych = *++p;
|
499
471
|
if (yych <= '9') {
|
500
|
-
if (yych <= '
|
501
|
-
if (yych
|
472
|
+
if (yych <= ',') {
|
473
|
+
if (yych != '+')
|
502
474
|
goto yy6;
|
503
475
|
} else {
|
504
|
-
if (yych
|
505
|
-
goto yy6;
|
506
|
-
if (yych >= '/')
|
476
|
+
if (yych == '/')
|
507
477
|
goto yy6;
|
508
478
|
}
|
509
479
|
} else {
|
@@ -521,13 +491,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
521
491
|
}
|
522
492
|
yych = *++p;
|
523
493
|
if (yych <= '9') {
|
524
|
-
if (yych <= '
|
525
|
-
if (yych
|
494
|
+
if (yych <= ',') {
|
495
|
+
if (yych != '+')
|
526
496
|
goto yy6;
|
527
497
|
} else {
|
528
|
-
if (yych
|
529
|
-
goto yy6;
|
530
|
-
if (yych >= '/')
|
498
|
+
if (yych == '/')
|
531
499
|
goto yy6;
|
532
500
|
}
|
533
501
|
} else {
|
@@ -545,13 +513,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
545
513
|
}
|
546
514
|
yych = *++p;
|
547
515
|
if (yych <= '9') {
|
548
|
-
if (yych <= '
|
549
|
-
if (yych
|
516
|
+
if (yych <= ',') {
|
517
|
+
if (yych != '+')
|
550
518
|
goto yy6;
|
551
519
|
} else {
|
552
|
-
if (yych
|
553
|
-
goto yy6;
|
554
|
-
if (yych >= '/')
|
520
|
+
if (yych == '/')
|
555
521
|
goto yy6;
|
556
522
|
}
|
557
523
|
} else {
|
@@ -569,13 +535,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
569
535
|
}
|
570
536
|
yych = *++p;
|
571
537
|
if (yych <= '9') {
|
572
|
-
if (yych <= '
|
573
|
-
if (yych
|
538
|
+
if (yych <= ',') {
|
539
|
+
if (yych != '+')
|
574
540
|
goto yy6;
|
575
541
|
} else {
|
576
|
-
if (yych
|
577
|
-
goto yy6;
|
578
|
-
if (yych >= '/')
|
542
|
+
if (yych == '/')
|
579
543
|
goto yy6;
|
580
544
|
}
|
581
545
|
} else {
|
@@ -593,13 +557,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
593
557
|
}
|
594
558
|
yych = *++p;
|
595
559
|
if (yych <= '9') {
|
596
|
-
if (yych <= '
|
597
|
-
if (yych
|
560
|
+
if (yych <= ',') {
|
561
|
+
if (yych != '+')
|
598
562
|
goto yy6;
|
599
563
|
} else {
|
600
|
-
if (yych
|
601
|
-
goto yy6;
|
602
|
-
if (yych >= '/')
|
564
|
+
if (yych == '/')
|
603
565
|
goto yy6;
|
604
566
|
}
|
605
567
|
} else {
|
@@ -617,13 +579,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
617
579
|
}
|
618
580
|
yych = *++p;
|
619
581
|
if (yych <= '9') {
|
620
|
-
if (yych <= '
|
621
|
-
if (yych
|
582
|
+
if (yych <= ',') {
|
583
|
+
if (yych != '+')
|
622
584
|
goto yy6;
|
623
585
|
} else {
|
624
|
-
if (yych
|
625
|
-
goto yy6;
|
626
|
-
if (yych >= '/')
|
586
|
+
if (yych == '/')
|
627
587
|
goto yy6;
|
628
588
|
}
|
629
589
|
} else {
|
@@ -641,13 +601,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
641
601
|
}
|
642
602
|
yych = *++p;
|
643
603
|
if (yych <= '9') {
|
644
|
-
if (yych <= '
|
645
|
-
if (yych
|
604
|
+
if (yych <= ',') {
|
605
|
+
if (yych != '+')
|
646
606
|
goto yy6;
|
647
607
|
} else {
|
648
|
-
if (yych
|
649
|
-
goto yy6;
|
650
|
-
if (yych >= '/')
|
608
|
+
if (yych == '/')
|
651
609
|
goto yy6;
|
652
610
|
}
|
653
611
|
} else {
|
@@ -665,13 +623,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
665
623
|
}
|
666
624
|
yych = *++p;
|
667
625
|
if (yych <= '9') {
|
668
|
-
if (yych <= '
|
669
|
-
if (yych
|
626
|
+
if (yych <= ',') {
|
627
|
+
if (yych != '+')
|
670
628
|
goto yy6;
|
671
629
|
} else {
|
672
|
-
if (yych
|
673
|
-
goto yy6;
|
674
|
-
if (yych >= '/')
|
630
|
+
if (yych == '/')
|
675
631
|
goto yy6;
|
676
632
|
}
|
677
633
|
} else {
|
@@ -689,13 +645,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
689
645
|
}
|
690
646
|
yych = *++p;
|
691
647
|
if (yych <= '9') {
|
692
|
-
if (yych <= '
|
693
|
-
if (yych
|
648
|
+
if (yych <= ',') {
|
649
|
+
if (yych != '+')
|
694
650
|
goto yy6;
|
695
651
|
} else {
|
696
|
-
if (yych
|
697
|
-
goto yy6;
|
698
|
-
if (yych >= '/')
|
652
|
+
if (yych == '/')
|
699
653
|
goto yy6;
|
700
654
|
}
|
701
655
|
} else {
|
@@ -713,13 +667,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
713
667
|
}
|
714
668
|
yych = *++p;
|
715
669
|
if (yych <= '9') {
|
716
|
-
if (yych <= '
|
717
|
-
if (yych
|
670
|
+
if (yych <= ',') {
|
671
|
+
if (yych != '+')
|
718
672
|
goto yy6;
|
719
673
|
} else {
|
720
|
-
if (yych
|
721
|
-
goto yy6;
|
722
|
-
if (yych >= '/')
|
674
|
+
if (yych == '/')
|
723
675
|
goto yy6;
|
724
676
|
}
|
725
677
|
} else {
|
@@ -737,13 +689,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
737
689
|
}
|
738
690
|
yych = *++p;
|
739
691
|
if (yych <= '9') {
|
740
|
-
if (yych <= '
|
741
|
-
if (yych
|
692
|
+
if (yych <= ',') {
|
693
|
+
if (yych != '+')
|
742
694
|
goto yy6;
|
743
695
|
} else {
|
744
|
-
if (yych
|
745
|
-
goto yy6;
|
746
|
-
if (yych >= '/')
|
696
|
+
if (yych == '/')
|
747
697
|
goto yy6;
|
748
698
|
}
|
749
699
|
} else {
|
@@ -761,13 +711,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
761
711
|
}
|
762
712
|
yych = *++p;
|
763
713
|
if (yych <= '9') {
|
764
|
-
if (yych <= '
|
765
|
-
if (yych
|
714
|
+
if (yych <= ',') {
|
715
|
+
if (yych != '+')
|
766
716
|
goto yy6;
|
767
717
|
} else {
|
768
|
-
if (yych
|
769
|
-
goto yy6;
|
770
|
-
if (yych >= '/')
|
718
|
+
if (yych == '/')
|
771
719
|
goto yy6;
|
772
720
|
}
|
773
721
|
} else {
|
@@ -785,13 +733,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
785
733
|
}
|
786
734
|
yych = *++p;
|
787
735
|
if (yych <= '9') {
|
788
|
-
if (yych <= '
|
789
|
-
if (yych
|
736
|
+
if (yych <= ',') {
|
737
|
+
if (yych != '+')
|
790
738
|
goto yy6;
|
791
739
|
} else {
|
792
|
-
if (yych
|
793
|
-
goto yy6;
|
794
|
-
if (yych >= '/')
|
740
|
+
if (yych == '/')
|
795
741
|
goto yy6;
|
796
742
|
}
|
797
743
|
} else {
|
@@ -809,13 +755,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
809
755
|
}
|
810
756
|
yych = *++p;
|
811
757
|
if (yych <= '9') {
|
812
|
-
if (yych <= '
|
813
|
-
if (yych
|
758
|
+
if (yych <= ',') {
|
759
|
+
if (yych != '+')
|
814
760
|
goto yy6;
|
815
761
|
} else {
|
816
|
-
if (yych
|
817
|
-
goto yy6;
|
818
|
-
if (yych >= '/')
|
762
|
+
if (yych == '/')
|
819
763
|
goto yy6;
|
820
764
|
}
|
821
765
|
} else {
|
@@ -833,13 +777,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
833
777
|
}
|
834
778
|
yych = *++p;
|
835
779
|
if (yych <= '9') {
|
836
|
-
if (yych <= '
|
837
|
-
if (yych
|
780
|
+
if (yych <= ',') {
|
781
|
+
if (yych != '+')
|
838
782
|
goto yy6;
|
839
783
|
} else {
|
840
|
-
if (yych
|
841
|
-
goto yy6;
|
842
|
-
if (yych >= '/')
|
784
|
+
if (yych == '/')
|
843
785
|
goto yy6;
|
844
786
|
}
|
845
787
|
} else {
|
@@ -857,13 +799,11 @@ bufsize_t _scan_scheme(const unsigned char *p) {
|
|
857
799
|
}
|
858
800
|
yych = *++p;
|
859
801
|
if (yych <= '9') {
|
860
|
-
if (yych <= '
|
861
|
-
if (yych
|
802
|
+
if (yych <= ',') {
|
803
|
+
if (yych != '+')
|
862
804
|
goto yy6;
|
863
805
|
} else {
|
864
|
-
if (yych
|
865
|
-
goto yy6;
|
866
|
-
if (yych >= '/')
|
806
|
+
if (yych == '/')
|
867
807
|
goto yy6;
|
868
808
|
}
|
869
809
|
} else {
|
@@ -915,38 +855,30 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
915
855
|
0, 0, 0, 0,
|
916
856
|
};
|
917
857
|
yych = *(marker = p);
|
918
|
-
if (yych <=
|
919
|
-
if (yych <= '
|
858
|
+
if (yych <= 0xC1) {
|
859
|
+
if (yych <= 'Z') {
|
920
860
|
if (yych == '\n')
|
921
861
|
goto yy48;
|
922
|
-
if (yych <=
|
862
|
+
if (yych <= '@')
|
923
863
|
goto yy50;
|
924
864
|
goto yy49;
|
925
865
|
} else {
|
926
|
-
if (yych <= '
|
927
|
-
|
928
|
-
|
866
|
+
if (yych <= '`')
|
867
|
+
goto yy50;
|
868
|
+
if (yych <= 'z')
|
929
869
|
goto yy49;
|
930
|
-
|
931
|
-
if (yych <= '`')
|
932
|
-
goto yy50;
|
933
|
-
if (yych <= 'z')
|
934
|
-
goto yy49;
|
870
|
+
if (yych <= 0x7F)
|
935
871
|
goto yy50;
|
936
|
-
}
|
937
872
|
}
|
938
873
|
} else {
|
939
874
|
if (yych <= 0xED) {
|
940
|
-
if (yych <= 0xDF)
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
goto yy54;
|
948
|
-
goto yy58;
|
949
|
-
}
|
875
|
+
if (yych <= 0xDF)
|
876
|
+
goto yy51;
|
877
|
+
if (yych <= 0xE0)
|
878
|
+
goto yy53;
|
879
|
+
if (yych <= 0xEC)
|
880
|
+
goto yy54;
|
881
|
+
goto yy58;
|
950
882
|
} else {
|
951
883
|
if (yych <= 0xF0) {
|
952
884
|
if (yych <= 0xEF)
|
@@ -963,14 +895,22 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
963
895
|
yy48 : { return 0; }
|
964
896
|
yy49:
|
965
897
|
yych = *(marker = ++p);
|
966
|
-
if (yych <= '
|
967
|
-
if (yych
|
898
|
+
if (yych <= '/') {
|
899
|
+
if (yych <= '+') {
|
900
|
+
if (yych <= '*')
|
901
|
+
goto yy48;
|
968
902
|
goto yy59;
|
969
|
-
|
903
|
+
} else {
|
904
|
+
if (yych <= ',')
|
905
|
+
goto yy48;
|
906
|
+
if (yych <= '.')
|
907
|
+
goto yy59;
|
970
908
|
goto yy48;
|
971
|
-
|
909
|
+
}
|
972
910
|
} else {
|
973
911
|
if (yych <= 'Z') {
|
912
|
+
if (yych <= '9')
|
913
|
+
goto yy59;
|
974
914
|
if (yych <= '@')
|
975
915
|
goto yy48;
|
976
916
|
goto yy59;
|
@@ -1039,16 +979,14 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1039
979
|
yy59:
|
1040
980
|
yych = *++p;
|
1041
981
|
if (yych <= '9') {
|
1042
|
-
if (yych <= '
|
1043
|
-
if (yych
|
1044
|
-
goto yy52;
|
1045
|
-
goto yy62;
|
1046
|
-
} else {
|
1047
|
-
if (yych <= ',')
|
1048
|
-
goto yy52;
|
1049
|
-
if (yych <= '.')
|
982
|
+
if (yych <= ',') {
|
983
|
+
if (yych == '+')
|
1050
984
|
goto yy62;
|
1051
985
|
goto yy52;
|
986
|
+
} else {
|
987
|
+
if (yych == '/')
|
988
|
+
goto yy52;
|
989
|
+
goto yy62;
|
1052
990
|
}
|
1053
991
|
} else {
|
1054
992
|
if (yych <= 'Z') {
|
@@ -1103,13 +1041,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1103
1041
|
yy62:
|
1104
1042
|
yych = *++p;
|
1105
1043
|
if (yych <= '9') {
|
1106
|
-
if (yych <= '
|
1107
|
-
if (yych
|
1044
|
+
if (yych <= ',') {
|
1045
|
+
if (yych != '+')
|
1108
1046
|
goto yy52;
|
1109
1047
|
} else {
|
1110
|
-
if (yych
|
1111
|
-
goto yy52;
|
1112
|
-
if (yych >= '/')
|
1048
|
+
if (yych == '/')
|
1113
1049
|
goto yy52;
|
1114
1050
|
}
|
1115
1051
|
} else {
|
@@ -1127,13 +1063,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1127
1063
|
}
|
1128
1064
|
yych = *++p;
|
1129
1065
|
if (yych <= '9') {
|
1130
|
-
if (yych <= '
|
1131
|
-
if (yych
|
1066
|
+
if (yych <= ',') {
|
1067
|
+
if (yych != '+')
|
1132
1068
|
goto yy52;
|
1133
1069
|
} else {
|
1134
|
-
if (yych
|
1135
|
-
goto yy52;
|
1136
|
-
if (yych >= '/')
|
1070
|
+
if (yych == '/')
|
1137
1071
|
goto yy52;
|
1138
1072
|
}
|
1139
1073
|
} else {
|
@@ -1151,13 +1085,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1151
1085
|
}
|
1152
1086
|
yych = *++p;
|
1153
1087
|
if (yych <= '9') {
|
1154
|
-
if (yych <= '
|
1155
|
-
if (yych
|
1088
|
+
if (yych <= ',') {
|
1089
|
+
if (yych != '+')
|
1156
1090
|
goto yy52;
|
1157
1091
|
} else {
|
1158
|
-
if (yych
|
1159
|
-
goto yy52;
|
1160
|
-
if (yych >= '/')
|
1092
|
+
if (yych == '/')
|
1161
1093
|
goto yy52;
|
1162
1094
|
}
|
1163
1095
|
} else {
|
@@ -1175,13 +1107,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1175
1107
|
}
|
1176
1108
|
yych = *++p;
|
1177
1109
|
if (yych <= '9') {
|
1178
|
-
if (yych <= '
|
1179
|
-
if (yych
|
1110
|
+
if (yych <= ',') {
|
1111
|
+
if (yych != '+')
|
1180
1112
|
goto yy52;
|
1181
1113
|
} else {
|
1182
|
-
if (yych
|
1183
|
-
goto yy52;
|
1184
|
-
if (yych >= '/')
|
1114
|
+
if (yych == '/')
|
1185
1115
|
goto yy52;
|
1186
1116
|
}
|
1187
1117
|
} else {
|
@@ -1199,13 +1129,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1199
1129
|
}
|
1200
1130
|
yych = *++p;
|
1201
1131
|
if (yych <= '9') {
|
1202
|
-
if (yych <= '
|
1203
|
-
if (yych
|
1132
|
+
if (yych <= ',') {
|
1133
|
+
if (yych != '+')
|
1204
1134
|
goto yy52;
|
1205
1135
|
} else {
|
1206
|
-
if (yych
|
1207
|
-
goto yy52;
|
1208
|
-
if (yych >= '/')
|
1136
|
+
if (yych == '/')
|
1209
1137
|
goto yy52;
|
1210
1138
|
}
|
1211
1139
|
} else {
|
@@ -1223,13 +1151,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1223
1151
|
}
|
1224
1152
|
yych = *++p;
|
1225
1153
|
if (yych <= '9') {
|
1226
|
-
if (yych <= '
|
1227
|
-
if (yych
|
1154
|
+
if (yych <= ',') {
|
1155
|
+
if (yych != '+')
|
1228
1156
|
goto yy52;
|
1229
1157
|
} else {
|
1230
|
-
if (yych
|
1231
|
-
goto yy52;
|
1232
|
-
if (yych >= '/')
|
1158
|
+
if (yych == '/')
|
1233
1159
|
goto yy52;
|
1234
1160
|
}
|
1235
1161
|
} else {
|
@@ -1247,13 +1173,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1247
1173
|
}
|
1248
1174
|
yych = *++p;
|
1249
1175
|
if (yych <= '9') {
|
1250
|
-
if (yych <= '
|
1251
|
-
if (yych
|
1176
|
+
if (yych <= ',') {
|
1177
|
+
if (yych != '+')
|
1252
1178
|
goto yy52;
|
1253
1179
|
} else {
|
1254
|
-
if (yych
|
1255
|
-
goto yy52;
|
1256
|
-
if (yych >= '/')
|
1180
|
+
if (yych == '/')
|
1257
1181
|
goto yy52;
|
1258
1182
|
}
|
1259
1183
|
} else {
|
@@ -1271,13 +1195,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1271
1195
|
}
|
1272
1196
|
yych = *++p;
|
1273
1197
|
if (yych <= '9') {
|
1274
|
-
if (yych <= '
|
1275
|
-
if (yych
|
1198
|
+
if (yych <= ',') {
|
1199
|
+
if (yych != '+')
|
1276
1200
|
goto yy52;
|
1277
1201
|
} else {
|
1278
|
-
if (yych
|
1279
|
-
goto yy52;
|
1280
|
-
if (yych >= '/')
|
1202
|
+
if (yych == '/')
|
1281
1203
|
goto yy52;
|
1282
1204
|
}
|
1283
1205
|
} else {
|
@@ -1295,13 +1217,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1295
1217
|
}
|
1296
1218
|
yych = *++p;
|
1297
1219
|
if (yych <= '9') {
|
1298
|
-
if (yych <= '
|
1299
|
-
if (yych
|
1220
|
+
if (yych <= ',') {
|
1221
|
+
if (yych != '+')
|
1300
1222
|
goto yy52;
|
1301
1223
|
} else {
|
1302
|
-
if (yych
|
1303
|
-
goto yy52;
|
1304
|
-
if (yych >= '/')
|
1224
|
+
if (yych == '/')
|
1305
1225
|
goto yy52;
|
1306
1226
|
}
|
1307
1227
|
} else {
|
@@ -1319,13 +1239,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1319
1239
|
}
|
1320
1240
|
yych = *++p;
|
1321
1241
|
if (yych <= '9') {
|
1322
|
-
if (yych <= '
|
1323
|
-
if (yych
|
1242
|
+
if (yych <= ',') {
|
1243
|
+
if (yych != '+')
|
1324
1244
|
goto yy52;
|
1325
1245
|
} else {
|
1326
|
-
if (yych
|
1327
|
-
goto yy52;
|
1328
|
-
if (yych >= '/')
|
1246
|
+
if (yych == '/')
|
1329
1247
|
goto yy52;
|
1330
1248
|
}
|
1331
1249
|
} else {
|
@@ -1343,13 +1261,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1343
1261
|
}
|
1344
1262
|
yych = *++p;
|
1345
1263
|
if (yych <= '9') {
|
1346
|
-
if (yych <= '
|
1347
|
-
if (yych
|
1264
|
+
if (yych <= ',') {
|
1265
|
+
if (yych != '+')
|
1348
1266
|
goto yy52;
|
1349
1267
|
} else {
|
1350
|
-
if (yych
|
1351
|
-
goto yy52;
|
1352
|
-
if (yych >= '/')
|
1268
|
+
if (yych == '/')
|
1353
1269
|
goto yy52;
|
1354
1270
|
}
|
1355
1271
|
} else {
|
@@ -1367,13 +1283,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1367
1283
|
}
|
1368
1284
|
yych = *++p;
|
1369
1285
|
if (yych <= '9') {
|
1370
|
-
if (yych <= '
|
1371
|
-
if (yych
|
1286
|
+
if (yych <= ',') {
|
1287
|
+
if (yych != '+')
|
1372
1288
|
goto yy52;
|
1373
1289
|
} else {
|
1374
|
-
if (yych
|
1375
|
-
goto yy52;
|
1376
|
-
if (yych >= '/')
|
1290
|
+
if (yych == '/')
|
1377
1291
|
goto yy52;
|
1378
1292
|
}
|
1379
1293
|
} else {
|
@@ -1391,13 +1305,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1391
1305
|
}
|
1392
1306
|
yych = *++p;
|
1393
1307
|
if (yych <= '9') {
|
1394
|
-
if (yych <= '
|
1395
|
-
if (yych
|
1308
|
+
if (yych <= ',') {
|
1309
|
+
if (yych != '+')
|
1396
1310
|
goto yy52;
|
1397
1311
|
} else {
|
1398
|
-
if (yych
|
1399
|
-
goto yy52;
|
1400
|
-
if (yych >= '/')
|
1312
|
+
if (yych == '/')
|
1401
1313
|
goto yy52;
|
1402
1314
|
}
|
1403
1315
|
} else {
|
@@ -1415,13 +1327,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1415
1327
|
}
|
1416
1328
|
yych = *++p;
|
1417
1329
|
if (yych <= '9') {
|
1418
|
-
if (yych <= '
|
1419
|
-
if (yych
|
1330
|
+
if (yych <= ',') {
|
1331
|
+
if (yych != '+')
|
1420
1332
|
goto yy52;
|
1421
1333
|
} else {
|
1422
|
-
if (yych
|
1423
|
-
goto yy52;
|
1424
|
-
if (yych >= '/')
|
1334
|
+
if (yych == '/')
|
1425
1335
|
goto yy52;
|
1426
1336
|
}
|
1427
1337
|
} else {
|
@@ -1439,13 +1349,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1439
1349
|
}
|
1440
1350
|
yych = *++p;
|
1441
1351
|
if (yych <= '9') {
|
1442
|
-
if (yych <= '
|
1443
|
-
if (yych
|
1352
|
+
if (yych <= ',') {
|
1353
|
+
if (yych != '+')
|
1444
1354
|
goto yy52;
|
1445
1355
|
} else {
|
1446
|
-
if (yych
|
1447
|
-
goto yy52;
|
1448
|
-
if (yych >= '/')
|
1356
|
+
if (yych == '/')
|
1449
1357
|
goto yy52;
|
1450
1358
|
}
|
1451
1359
|
} else {
|
@@ -1463,13 +1371,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1463
1371
|
}
|
1464
1372
|
yych = *++p;
|
1465
1373
|
if (yych <= '9') {
|
1466
|
-
if (yych <= '
|
1467
|
-
if (yych
|
1374
|
+
if (yych <= ',') {
|
1375
|
+
if (yych != '+')
|
1468
1376
|
goto yy52;
|
1469
1377
|
} else {
|
1470
|
-
if (yych
|
1471
|
-
goto yy52;
|
1472
|
-
if (yych >= '/')
|
1378
|
+
if (yych == '/')
|
1473
1379
|
goto yy52;
|
1474
1380
|
}
|
1475
1381
|
} else {
|
@@ -1487,13 +1393,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1487
1393
|
}
|
1488
1394
|
yych = *++p;
|
1489
1395
|
if (yych <= '9') {
|
1490
|
-
if (yych <= '
|
1491
|
-
if (yych
|
1396
|
+
if (yych <= ',') {
|
1397
|
+
if (yych != '+')
|
1492
1398
|
goto yy52;
|
1493
1399
|
} else {
|
1494
|
-
if (yych
|
1495
|
-
goto yy52;
|
1496
|
-
if (yych >= '/')
|
1400
|
+
if (yych == '/')
|
1497
1401
|
goto yy52;
|
1498
1402
|
}
|
1499
1403
|
} else {
|
@@ -1511,13 +1415,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1511
1415
|
}
|
1512
1416
|
yych = *++p;
|
1513
1417
|
if (yych <= '9') {
|
1514
|
-
if (yych <= '
|
1515
|
-
if (yych
|
1418
|
+
if (yych <= ',') {
|
1419
|
+
if (yych != '+')
|
1516
1420
|
goto yy52;
|
1517
1421
|
} else {
|
1518
|
-
if (yych
|
1519
|
-
goto yy52;
|
1520
|
-
if (yych >= '/')
|
1422
|
+
if (yych == '/')
|
1521
1423
|
goto yy52;
|
1522
1424
|
}
|
1523
1425
|
} else {
|
@@ -1535,13 +1437,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1535
1437
|
}
|
1536
1438
|
yych = *++p;
|
1537
1439
|
if (yych <= '9') {
|
1538
|
-
if (yych <= '
|
1539
|
-
if (yych
|
1440
|
+
if (yych <= ',') {
|
1441
|
+
if (yych != '+')
|
1540
1442
|
goto yy52;
|
1541
1443
|
} else {
|
1542
|
-
if (yych
|
1543
|
-
goto yy52;
|
1544
|
-
if (yych >= '/')
|
1444
|
+
if (yych == '/')
|
1545
1445
|
goto yy52;
|
1546
1446
|
}
|
1547
1447
|
} else {
|
@@ -1559,13 +1459,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1559
1459
|
}
|
1560
1460
|
yych = *++p;
|
1561
1461
|
if (yych <= '9') {
|
1562
|
-
if (yych <= '
|
1563
|
-
if (yych
|
1462
|
+
if (yych <= ',') {
|
1463
|
+
if (yych != '+')
|
1564
1464
|
goto yy52;
|
1565
1465
|
} else {
|
1566
|
-
if (yych
|
1567
|
-
goto yy52;
|
1568
|
-
if (yych >= '/')
|
1466
|
+
if (yych == '/')
|
1569
1467
|
goto yy52;
|
1570
1468
|
}
|
1571
1469
|
} else {
|
@@ -1583,13 +1481,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1583
1481
|
}
|
1584
1482
|
yych = *++p;
|
1585
1483
|
if (yych <= '9') {
|
1586
|
-
if (yych <= '
|
1587
|
-
if (yych
|
1484
|
+
if (yych <= ',') {
|
1485
|
+
if (yych != '+')
|
1588
1486
|
goto yy52;
|
1589
1487
|
} else {
|
1590
|
-
if (yych
|
1591
|
-
goto yy52;
|
1592
|
-
if (yych >= '/')
|
1488
|
+
if (yych == '/')
|
1593
1489
|
goto yy52;
|
1594
1490
|
}
|
1595
1491
|
} else {
|
@@ -1607,13 +1503,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1607
1503
|
}
|
1608
1504
|
yych = *++p;
|
1609
1505
|
if (yych <= '9') {
|
1610
|
-
if (yych <= '
|
1611
|
-
if (yych
|
1506
|
+
if (yych <= ',') {
|
1507
|
+
if (yych != '+')
|
1612
1508
|
goto yy52;
|
1613
1509
|
} else {
|
1614
|
-
if (yych
|
1615
|
-
goto yy52;
|
1616
|
-
if (yych >= '/')
|
1510
|
+
if (yych == '/')
|
1617
1511
|
goto yy52;
|
1618
1512
|
}
|
1619
1513
|
} else {
|
@@ -1631,13 +1525,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1631
1525
|
}
|
1632
1526
|
yych = *++p;
|
1633
1527
|
if (yych <= '9') {
|
1634
|
-
if (yych <= '
|
1635
|
-
if (yych
|
1528
|
+
if (yych <= ',') {
|
1529
|
+
if (yych != '+')
|
1636
1530
|
goto yy52;
|
1637
1531
|
} else {
|
1638
|
-
if (yych
|
1639
|
-
goto yy52;
|
1640
|
-
if (yych >= '/')
|
1532
|
+
if (yych == '/')
|
1641
1533
|
goto yy52;
|
1642
1534
|
}
|
1643
1535
|
} else {
|
@@ -1655,13 +1547,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1655
1547
|
}
|
1656
1548
|
yych = *++p;
|
1657
1549
|
if (yych <= '9') {
|
1658
|
-
if (yych <= '
|
1659
|
-
if (yych
|
1550
|
+
if (yych <= ',') {
|
1551
|
+
if (yych != '+')
|
1660
1552
|
goto yy52;
|
1661
1553
|
} else {
|
1662
|
-
if (yych
|
1663
|
-
goto yy52;
|
1664
|
-
if (yych >= '/')
|
1554
|
+
if (yych == '/')
|
1665
1555
|
goto yy52;
|
1666
1556
|
}
|
1667
1557
|
} else {
|
@@ -1679,13 +1569,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1679
1569
|
}
|
1680
1570
|
yych = *++p;
|
1681
1571
|
if (yych <= '9') {
|
1682
|
-
if (yych <= '
|
1683
|
-
if (yych
|
1572
|
+
if (yych <= ',') {
|
1573
|
+
if (yych != '+')
|
1684
1574
|
goto yy52;
|
1685
1575
|
} else {
|
1686
|
-
if (yych
|
1687
|
-
goto yy52;
|
1688
|
-
if (yych >= '/')
|
1576
|
+
if (yych == '/')
|
1689
1577
|
goto yy52;
|
1690
1578
|
}
|
1691
1579
|
} else {
|
@@ -1703,13 +1591,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1703
1591
|
}
|
1704
1592
|
yych = *++p;
|
1705
1593
|
if (yych <= '9') {
|
1706
|
-
if (yych <= '
|
1707
|
-
if (yych
|
1594
|
+
if (yych <= ',') {
|
1595
|
+
if (yych != '+')
|
1708
1596
|
goto yy52;
|
1709
1597
|
} else {
|
1710
|
-
if (yych
|
1711
|
-
goto yy52;
|
1712
|
-
if (yych >= '/')
|
1598
|
+
if (yych == '/')
|
1713
1599
|
goto yy52;
|
1714
1600
|
}
|
1715
1601
|
} else {
|
@@ -1727,13 +1613,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1727
1613
|
}
|
1728
1614
|
yych = *++p;
|
1729
1615
|
if (yych <= '9') {
|
1730
|
-
if (yych <= '
|
1731
|
-
if (yych
|
1616
|
+
if (yych <= ',') {
|
1617
|
+
if (yych != '+')
|
1732
1618
|
goto yy52;
|
1733
1619
|
} else {
|
1734
|
-
if (yych
|
1735
|
-
goto yy52;
|
1736
|
-
if (yych >= '/')
|
1620
|
+
if (yych == '/')
|
1737
1621
|
goto yy52;
|
1738
1622
|
}
|
1739
1623
|
} else {
|
@@ -1751,13 +1635,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1751
1635
|
}
|
1752
1636
|
yych = *++p;
|
1753
1637
|
if (yych <= '9') {
|
1754
|
-
if (yych <= '
|
1755
|
-
if (yych
|
1638
|
+
if (yych <= ',') {
|
1639
|
+
if (yych != '+')
|
1756
1640
|
goto yy52;
|
1757
1641
|
} else {
|
1758
|
-
if (yych
|
1759
|
-
goto yy52;
|
1760
|
-
if (yych >= '/')
|
1642
|
+
if (yych == '/')
|
1761
1643
|
goto yy52;
|
1762
1644
|
}
|
1763
1645
|
} else {
|
@@ -1775,13 +1657,11 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
|
|
1775
1657
|
}
|
1776
1658
|
yych = *++p;
|
1777
1659
|
if (yych <= '9') {
|
1778
|
-
if (yych <= '
|
1779
|
-
if (yych
|
1660
|
+
if (yych <= ',') {
|
1661
|
+
if (yych != '+')
|
1780
1662
|
goto yy52;
|
1781
1663
|
} else {
|
1782
|
-
if (yych
|
1783
|
-
goto yy52;
|
1784
|
-
if (yych >= '/')
|
1664
|
+
if (yych == '/')
|
1785
1665
|
goto yy52;
|
1786
1666
|
}
|
1787
1667
|
} else {
|
@@ -8258,45 +8138,37 @@ bufsize_t _scan_html_tag(const unsigned char *p) {
|
|
8258
8138
|
unsigned char yych;
|
8259
8139
|
static const unsigned char yybm[] = {
|
8260
8140
|
/* table 1 .. 8: 0 */
|
8261
|
-
0,
|
8141
|
+
0, 230, 230, 230, 230, 230, 230, 230, 230, 199, 199, 199, 199, 199, 230,
|
8262
8142
|
230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
|
8263
|
-
230, 230, 230,
|
8264
|
-
230, 230,
|
8265
|
-
254,
|
8143
|
+
230, 230, 230, 199, 230, 70, 230, 230, 230, 230, 134, 230, 230, 230,
|
8144
|
+
230, 230, 254, 246, 230, 254, 254, 254, 254, 254, 254, 254, 254, 254,
|
8145
|
+
254, 246, 230, 198, 198, 196, 230, 230, 254, 254, 254, 254, 254, 254,
|
8266
8146
|
254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
|
8267
|
-
254, 254, 254, 254, 254, 254,
|
8147
|
+
254, 254, 254, 254, 254, 254, 230, 230, 226, 230, 246, 198, 254, 254,
|
8268
8148
|
254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
|
8269
|
-
254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
|
8270
|
-
230,
|
8271
|
-
0,
|
8272
|
-
0,
|
8273
|
-
0,
|
8274
|
-
0,
|
8275
|
-
0,
|
8276
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8277
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8278
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8279
|
-
0, 0, 0, 0,
|
8149
|
+
254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 230, 230, 230, 230,
|
8150
|
+
230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8151
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8152
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8153
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8154
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8155
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8280
8156
|
/* table 9 .. 11: 256 */
|
8281
|
-
0,
|
8157
|
+
0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
8282
8158
|
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
8283
8159
|
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
8284
|
-
160, 160, 160,
|
8285
|
-
160, 160, 160, 160, 160, 160,
|
8160
|
+
160, 160, 32, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
8161
|
+
160, 160, 160, 160, 160, 160, 128, 160, 224, 224, 224, 224, 224, 224,
|
8286
8162
|
224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
|
8287
|
-
224, 224, 224, 224, 224, 224,
|
8163
|
+
224, 224, 224, 224, 224, 224, 160, 160, 160, 160, 160, 160, 160, 160,
|
8288
8164
|
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
8289
8165
|
160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
|
8290
|
-
160,
|
8291
|
-
0,
|
8292
|
-
0,
|
8293
|
-
0,
|
8294
|
-
0,
|
8295
|
-
0,
|
8296
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8297
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8298
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8299
|
-
0, 0, 0, 0,
|
8166
|
+
160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8167
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8168
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8169
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8170
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8171
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
8300
8172
|
};
|
8301
8173
|
yych = *(marker = p);
|
8302
8174
|
if (yych <= '`') {
|
@@ -10582,7 +10454,9 @@ bufsize_t _scan_html_block_start(const unsigned char *p) {
|
|
10582
10454
|
yych = *++p;
|
10583
10455
|
if (yych <= 'S') {
|
10584
10456
|
if (yych <= 'D') {
|
10585
|
-
if (yych
|
10457
|
+
if (yych <= '0')
|
10458
|
+
goto yy525;
|
10459
|
+
if (yych <= '6')
|
10586
10460
|
goto yy564;
|
10587
10461
|
goto yy525;
|
10588
10462
|
} else {
|