commonmarker 0.17.7.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +19 -17
- data/commonmarker.gemspec +1 -1
- data/ext/commonmarker/arena.c +2 -2
- data/ext/commonmarker/autolink.h +3 -3
- data/ext/commonmarker/blocks.c +21 -15
- data/ext/commonmarker/buffer.h +23 -23
- data/ext/commonmarker/chunk.h +1 -1
- data/ext/commonmarker/cmark-gfm-core-extensions.h +28 -0
- data/ext/commonmarker/{cmark_extension_api.h → cmark-gfm-extension_api.h} +86 -69
- data/ext/commonmarker/cmark-gfm-extensions_export.h +42 -0
- data/ext/commonmarker/{cmark.h → cmark-gfm.h} +118 -96
- data/ext/commonmarker/cmark-gfm_export.h +42 -0
- data/ext/commonmarker/cmark-gfm_version.h +7 -0
- data/ext/commonmarker/cmark.c +3 -3
- data/ext/commonmarker/cmark_ctype.h +6 -6
- data/ext/commonmarker/commonmark.c +8 -4
- data/ext/commonmarker/commonmarker.c +33 -15
- data/ext/commonmarker/commonmarker.h +1 -1
- data/ext/commonmarker/core-extensions.c +2 -2
- data/ext/commonmarker/ext_scanners.h +1 -1
- data/ext/commonmarker/footnotes.c +1 -1
- data/ext/commonmarker/houdini.h +6 -6
- data/ext/commonmarker/houdini_href_e.c +2 -2
- data/ext/commonmarker/html.c +15 -7
- data/ext/commonmarker/inlines.c +36 -5
- data/ext/commonmarker/inlines.h +1 -1
- data/ext/commonmarker/iterator.c +1 -1
- data/ext/commonmarker/iterator.h +1 -1
- data/ext/commonmarker/latex.c +1 -1
- data/ext/commonmarker/linked_list.c +1 -1
- data/ext/commonmarker/man.c +1 -1
- data/ext/commonmarker/node.c +17 -3
- data/ext/commonmarker/node.h +4 -4
- data/ext/commonmarker/plugin.h +2 -2
- data/ext/commonmarker/references.c +1 -1
- data/ext/commonmarker/registry.c +1 -1
- data/ext/commonmarker/registry.h +4 -4
- data/ext/commonmarker/render.c +1 -1
- data/ext/commonmarker/scanners.c +10550 -18051
- data/ext/commonmarker/scanners.h +1 -1
- data/ext/commonmarker/strikethrough.c +13 -3
- data/ext/commonmarker/strikethrough.h +3 -3
- data/ext/commonmarker/syntax_extension.c +11 -1
- data/ext/commonmarker/syntax_extension.h +4 -2
- data/ext/commonmarker/table.c +88 -9
- data/ext/commonmarker/table.h +7 -3
- data/ext/commonmarker/tagfilter.h +3 -3
- data/ext/commonmarker/utf8.h +6 -6
- data/ext/commonmarker/xml.c +10 -3
- data/lib/commonmarker/config.rb +4 -1
- data/lib/commonmarker/node.rb +6 -4
- data/lib/commonmarker/renderer/html_renderer.rb +12 -12
- data/lib/commonmarker/version.rb +1 -1
- data/test/test_extensions.rb +52 -1
- data/test/test_footnotes.rb +1 -1
- data/test/test_options.rb +35 -0
- data/test/test_spec.rb +4 -4
- metadata +12 -10
- data/ext/commonmarker/cmark_export.h +0 -42
- data/ext/commonmarker/cmark_version.h +0 -8
- data/ext/commonmarker/cmarkextensions_export.h +0 -42
- data/ext/commonmarker/core-extensions.h +0 -25
data/test/test_spec.rb
CHANGED
|
@@ -9,18 +9,18 @@ class TestSpec < Minitest::Test
|
|
|
9
9
|
doc = CommonMarker.render_doc(testcase[:markdown], :DEFAULT, testcase[:extensions])
|
|
10
10
|
|
|
11
11
|
define_method("test_to_html_example_#{testcase[:example]}") do
|
|
12
|
-
actual = doc.to_html(:
|
|
12
|
+
actual = doc.to_html(:UNSAFE, testcase[:extensions]).rstrip
|
|
13
13
|
assert_equal testcase[:html], actual, testcase[:markdown]
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
define_method("test_html_renderer_example_#{testcase[:example]}") do
|
|
17
|
-
actual = HtmlRenderer.new(extensions: testcase[:extensions]).render(doc).rstrip
|
|
17
|
+
actual = HtmlRenderer.new(options: :UNSAFE, extensions: testcase[:extensions]).render(doc).rstrip
|
|
18
18
|
assert_equal testcase[:html], actual, testcase[:markdown]
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
define_method("test_sourcepos_example_#{testcase[:example]}") do
|
|
22
|
-
lhs = doc.to_html(:SOURCEPOS, testcase[:extensions]).rstrip
|
|
23
|
-
rhs = HtmlRenderer.new(options: :SOURCEPOS, extensions: testcase[:extensions]).render(doc).rstrip
|
|
22
|
+
lhs = doc.to_html([:UNSAFE, :SOURCEPOS], testcase[:extensions]).rstrip
|
|
23
|
+
rhs = HtmlRenderer.new(options: [:UNSAFE, :SOURCEPOS], extensions: testcase[:extensions]).render(doc).rstrip
|
|
24
24
|
assert_equal lhs, rhs, testcase[:markdown]
|
|
25
25
|
end
|
|
26
26
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: commonmarker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
8
|
-
-
|
|
8
|
+
- Ashe Connor
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: ruby-enum
|
|
@@ -131,20 +131,20 @@ files:
|
|
|
131
131
|
- ext/commonmarker/buffer.h
|
|
132
132
|
- ext/commonmarker/case_fold_switch.inc
|
|
133
133
|
- ext/commonmarker/chunk.h
|
|
134
|
+
- ext/commonmarker/cmark-gfm-core-extensions.h
|
|
135
|
+
- ext/commonmarker/cmark-gfm-extension_api.h
|
|
136
|
+
- ext/commonmarker/cmark-gfm-extensions_export.h
|
|
137
|
+
- ext/commonmarker/cmark-gfm.h
|
|
138
|
+
- ext/commonmarker/cmark-gfm_export.h
|
|
139
|
+
- ext/commonmarker/cmark-gfm_version.h
|
|
134
140
|
- ext/commonmarker/cmark.c
|
|
135
|
-
- ext/commonmarker/cmark.h
|
|
136
141
|
- ext/commonmarker/cmark_ctype.c
|
|
137
142
|
- ext/commonmarker/cmark_ctype.h
|
|
138
|
-
- ext/commonmarker/cmark_export.h
|
|
139
|
-
- ext/commonmarker/cmark_extension_api.h
|
|
140
|
-
- ext/commonmarker/cmark_version.h
|
|
141
|
-
- ext/commonmarker/cmarkextensions_export.h
|
|
142
143
|
- ext/commonmarker/commonmark.c
|
|
143
144
|
- ext/commonmarker/commonmarker.c
|
|
144
145
|
- ext/commonmarker/commonmarker.h
|
|
145
146
|
- ext/commonmarker/config.h
|
|
146
147
|
- ext/commonmarker/core-extensions.c
|
|
147
|
-
- ext/commonmarker/core-extensions.h
|
|
148
148
|
- ext/commonmarker/entities.inc
|
|
149
149
|
- ext/commonmarker/ext_scanners.c
|
|
150
150
|
- ext/commonmarker/ext_scanners.h
|
|
@@ -214,6 +214,7 @@ files:
|
|
|
214
214
|
- test/test_linebreaks.rb
|
|
215
215
|
- test/test_maliciousness.rb
|
|
216
216
|
- test/test_node.rb
|
|
217
|
+
- test/test_options.rb
|
|
217
218
|
- test/test_pathological_inputs.rb
|
|
218
219
|
- test/test_plaintext.rb
|
|
219
220
|
- test/test_renderer.rb
|
|
@@ -242,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
242
243
|
version: '0'
|
|
243
244
|
requirements: []
|
|
244
245
|
rubyforge_project:
|
|
245
|
-
rubygems_version: 2.5.
|
|
246
|
+
rubygems_version: 2.5.2.3
|
|
246
247
|
signing_key:
|
|
247
248
|
specification_version: 4
|
|
248
249
|
summary: CommonMark parser and renderer. Written in C, wrapped in Ruby.
|
|
@@ -262,6 +263,7 @@ test_files:
|
|
|
262
263
|
- test/test_linebreaks.rb
|
|
263
264
|
- test/test_maliciousness.rb
|
|
264
265
|
- test/test_node.rb
|
|
266
|
+
- test/test_options.rb
|
|
265
267
|
- test/test_pathological_inputs.rb
|
|
266
268
|
- test/test_plaintext.rb
|
|
267
269
|
- test/test_renderer.rb
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#ifndef CMARK_EXPORT_H
|
|
3
|
-
#define CMARK_EXPORT_H
|
|
4
|
-
|
|
5
|
-
#ifdef CMARK_STATIC_DEFINE
|
|
6
|
-
# define CMARK_EXPORT
|
|
7
|
-
# define CMARK_NO_EXPORT
|
|
8
|
-
#else
|
|
9
|
-
# ifndef CMARK_EXPORT
|
|
10
|
-
# ifdef libcmark_gfm_EXPORTS
|
|
11
|
-
/* We are building this library */
|
|
12
|
-
# define CMARK_EXPORT __attribute__((visibility("default")))
|
|
13
|
-
# else
|
|
14
|
-
/* We are using this library */
|
|
15
|
-
# define CMARK_EXPORT __attribute__((visibility("default")))
|
|
16
|
-
# endif
|
|
17
|
-
# endif
|
|
18
|
-
|
|
19
|
-
# ifndef CMARK_NO_EXPORT
|
|
20
|
-
# define CMARK_NO_EXPORT __attribute__((visibility("hidden")))
|
|
21
|
-
# endif
|
|
22
|
-
#endif
|
|
23
|
-
|
|
24
|
-
#ifndef CMARK_DEPRECATED
|
|
25
|
-
# define CMARK_DEPRECATED __attribute__ ((__deprecated__))
|
|
26
|
-
#endif
|
|
27
|
-
|
|
28
|
-
#ifndef CMARK_DEPRECATED_EXPORT
|
|
29
|
-
# define CMARK_DEPRECATED_EXPORT CMARK_EXPORT CMARK_DEPRECATED
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
#ifndef CMARK_DEPRECATED_NO_EXPORT
|
|
33
|
-
# define CMARK_DEPRECATED_NO_EXPORT CMARK_NO_EXPORT CMARK_DEPRECATED
|
|
34
|
-
#endif
|
|
35
|
-
|
|
36
|
-
#if 0 /* DEFINE_NO_DEPRECATED */
|
|
37
|
-
# ifndef CMARK_NO_DEPRECATED
|
|
38
|
-
# define CMARK_NO_DEPRECATED
|
|
39
|
-
# endif
|
|
40
|
-
#endif
|
|
41
|
-
|
|
42
|
-
#endif
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#ifndef CMARKEXTENSIONS_EXPORT_H
|
|
3
|
-
#define CMARKEXTENSIONS_EXPORT_H
|
|
4
|
-
|
|
5
|
-
#ifdef CMARKEXTENSIONS_STATIC_DEFINE
|
|
6
|
-
# define CMARKEXTENSIONS_EXPORT
|
|
7
|
-
# define CMARKEXTENSIONS_NO_EXPORT
|
|
8
|
-
#else
|
|
9
|
-
# ifndef CMARKEXTENSIONS_EXPORT
|
|
10
|
-
# ifdef libcmark_gfmextensions_EXPORTS
|
|
11
|
-
/* We are building this library */
|
|
12
|
-
# define CMARKEXTENSIONS_EXPORT __attribute__((visibility("default")))
|
|
13
|
-
# else
|
|
14
|
-
/* We are using this library */
|
|
15
|
-
# define CMARKEXTENSIONS_EXPORT __attribute__((visibility("default")))
|
|
16
|
-
# endif
|
|
17
|
-
# endif
|
|
18
|
-
|
|
19
|
-
# ifndef CMARKEXTENSIONS_NO_EXPORT
|
|
20
|
-
# define CMARKEXTENSIONS_NO_EXPORT __attribute__((visibility("hidden")))
|
|
21
|
-
# endif
|
|
22
|
-
#endif
|
|
23
|
-
|
|
24
|
-
#ifndef CMARKEXTENSIONS_DEPRECATED
|
|
25
|
-
# define CMARKEXTENSIONS_DEPRECATED __attribute__ ((__deprecated__))
|
|
26
|
-
#endif
|
|
27
|
-
|
|
28
|
-
#ifndef CMARKEXTENSIONS_DEPRECATED_EXPORT
|
|
29
|
-
# define CMARKEXTENSIONS_DEPRECATED_EXPORT CMARKEXTENSIONS_EXPORT CMARKEXTENSIONS_DEPRECATED
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
#ifndef CMARKEXTENSIONS_DEPRECATED_NO_EXPORT
|
|
33
|
-
# define CMARKEXTENSIONS_DEPRECATED_NO_EXPORT CMARKEXTENSIONS_NO_EXPORT CMARKEXTENSIONS_DEPRECATED
|
|
34
|
-
#endif
|
|
35
|
-
|
|
36
|
-
#if 0 /* DEFINE_NO_DEPRECATED */
|
|
37
|
-
# ifndef CMARKEXTENSIONS_NO_DEPRECATED
|
|
38
|
-
# define CMARKEXTENSIONS_NO_DEPRECATED
|
|
39
|
-
# endif
|
|
40
|
-
#endif
|
|
41
|
-
|
|
42
|
-
#endif
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#ifndef CORE_EXTENSIONS_H
|
|
2
|
-
#define CORE_EXTENSIONS_H
|
|
3
|
-
|
|
4
|
-
#ifdef __cplusplus
|
|
5
|
-
extern "C" {
|
|
6
|
-
#endif
|
|
7
|
-
|
|
8
|
-
#include <cmark_extension_api.h>
|
|
9
|
-
#include "cmarkextensions_export.h"
|
|
10
|
-
#include <stdint.h>
|
|
11
|
-
|
|
12
|
-
CMARKEXTENSIONS_EXPORT
|
|
13
|
-
void core_extensions_ensure_registered(void);
|
|
14
|
-
|
|
15
|
-
CMARKEXTENSIONS_EXPORT
|
|
16
|
-
uint16_t cmarkextensions_get_table_columns(cmark_node *node);
|
|
17
|
-
|
|
18
|
-
CMARKEXTENSIONS_EXPORT
|
|
19
|
-
uint8_t *cmarkextensions_get_table_alignments(cmark_node *node);
|
|
20
|
-
|
|
21
|
-
#ifdef __cplusplus
|
|
22
|
-
}
|
|
23
|
-
#endif
|
|
24
|
-
|
|
25
|
-
#endif
|