commonmarker 2.10.0 → 2.10.1
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/Cargo.lock +83 -40
- data/README.md +2 -2
- data/ext/commonmarker/Cargo.toml +3 -4
- data/ext/commonmarker/src/lib.rs +12 -2
- data/ext/commonmarker/src/nesting.rs +71 -0
- data/ext/commonmarker/src/node.rs +80 -87
- data/ext/commonmarker/src/options.rs +0 -4
- data/ext/commonmarker/src/plugins/syntax_highlighting.rs +9 -5
- data/ext/commonmarker/src/rctree.rs +841 -0
- data/lib/commonmarker/config.rb +1 -1
- data/lib/commonmarker/errors.rb +7 -0
- data/lib/commonmarker/node.rb +17 -4
- data/lib/commonmarker/version.rb +1 -1
- data/lib/commonmarker.rb +1 -0
- metadata +5 -2
data/lib/commonmarker/config.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Commonmarker
|
|
|
13
13
|
leave_footnote_definitions: false,
|
|
14
14
|
ignore_setext: false,
|
|
15
15
|
sourcepos_chars: false,
|
|
16
|
+
max_nesting_depth: 1000,
|
|
16
17
|
}.freeze,
|
|
17
18
|
render: {
|
|
18
19
|
hardbreaks: true,
|
|
@@ -32,7 +33,6 @@ module Commonmarker
|
|
|
32
33
|
}.freeze,
|
|
33
34
|
extension: {
|
|
34
35
|
strikethrough: true,
|
|
35
|
-
tagfilter: true,
|
|
36
36
|
table: true,
|
|
37
37
|
autolink: true,
|
|
38
38
|
tasklist: true,
|
data/lib/commonmarker/node.rb
CHANGED
|
@@ -20,15 +20,28 @@ module Commonmarker
|
|
|
20
20
|
super
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
# Public: An iterator that "walks the tree,"
|
|
23
|
+
# Public: An iterator that "walks the tree," yielding each node and then
|
|
24
|
+
# its descendants, in document order.
|
|
24
25
|
#
|
|
25
|
-
#
|
|
26
|
+
# The walk is iterative rather than recursive, so arbitrarily deep trees
|
|
27
|
+
# can't exhaust the stack.
|
|
28
|
+
#
|
|
29
|
+
# blk - A {Proc} representing the action to take for each node
|
|
26
30
|
def walk(&block)
|
|
27
31
|
return enum_for(:walk) unless block
|
|
28
32
|
|
|
29
33
|
yield self
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
|
|
35
|
+
# Like #each, the next sibling is captured before a node is yielded, so
|
|
36
|
+
# the block may detach or replace the node it is given. `pending` holds
|
|
37
|
+
# the sibling to resume at once each ancestor's subtree is done.
|
|
38
|
+
pending = []
|
|
39
|
+
node = first_child
|
|
40
|
+
while node
|
|
41
|
+
next_node = node.next_sibling
|
|
42
|
+
yield node
|
|
43
|
+
pending << next_node if next_node
|
|
44
|
+
node = node.first_child || pending.pop
|
|
32
45
|
end
|
|
33
46
|
end
|
|
34
47
|
|
data/lib/commonmarker/version.rb
CHANGED
data/lib/commonmarker.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: commonmarker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.10.
|
|
4
|
+
version: 2.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
@@ -39,14 +39,17 @@ files:
|
|
|
39
39
|
- ext/commonmarker/build.rs
|
|
40
40
|
- ext/commonmarker/extconf.rb
|
|
41
41
|
- ext/commonmarker/src/lib.rs
|
|
42
|
+
- ext/commonmarker/src/nesting.rs
|
|
42
43
|
- ext/commonmarker/src/node.rs
|
|
43
44
|
- ext/commonmarker/src/options.rs
|
|
44
45
|
- ext/commonmarker/src/plugins.rs
|
|
45
46
|
- ext/commonmarker/src/plugins/syntax_highlighting.rs
|
|
47
|
+
- ext/commonmarker/src/rctree.rs
|
|
46
48
|
- ext/commonmarker/src/utils.rs
|
|
47
49
|
- lib/commonmarker.rb
|
|
48
50
|
- lib/commonmarker/config.rb
|
|
49
51
|
- lib/commonmarker/constants.rb
|
|
52
|
+
- lib/commonmarker/errors.rb
|
|
50
53
|
- lib/commonmarker/extension.rb
|
|
51
54
|
- lib/commonmarker/node.rb
|
|
52
55
|
- lib/commonmarker/node/ast.rb
|
|
@@ -79,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
79
82
|
- !ruby/object:Gem::Version
|
|
80
83
|
version: '3.4'
|
|
81
84
|
requirements: []
|
|
82
|
-
rubygems_version: 4.0.
|
|
85
|
+
rubygems_version: 4.0.20
|
|
83
86
|
specification_version: 4
|
|
84
87
|
summary: CommonMark parser and renderer. Written in Rust, wrapped in Ruby.
|
|
85
88
|
test_files: []
|