commonmarker 0.20.0 → 0.20.1
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/commonmarker.gemspec +1 -1
- data/ext/commonmarker/tasklist.c +3 -2
- data/lib/commonmarker/renderer.rb +0 -2
- data/lib/commonmarker/renderer/html_renderer.rb +2 -2
- data/lib/commonmarker/version.rb +1 -1
- data/test/test_tasklists.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 237799ebff0e881aabc44799deac5c31a201307b
|
4
|
+
data.tar.gz: c2ebbe9b5bf5cc3ff8cb218c92a280eeb6aca70f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d5122a6869dc1b0e112a7ca8afcadfc53fda72c75f5bc0486e7046e59094f67f72f80955af1cc5fd6604ecea76361ee511c124b47f1c66f3f01496cf5a6b6ad
|
7
|
+
data.tar.gz: 39f7183d9f048c72729a916cefca93fecdc55e95054ff019fdeddc2ad94be5dbeb61c2c4ef7175373a0c2d520a72ad3743e415700bcbade0eb5dcdc37443ed16
|
data/commonmarker.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.files = %w(LICENSE.txt README.md Rakefile commonmarker.gemspec bin/commonmarker)
|
19
19
|
s.files += Dir.glob('lib/**/*.rb')
|
20
20
|
s.files += Dir.glob('ext/commonmarker/*.*')
|
21
|
-
s.test_files = Dir.glob('test/**/*')
|
21
|
+
s.test_files = Dir.glob('test/**/*').reject { |f| f == 'test/benchinput.md' || f.start_with?('test/progit/') }
|
22
22
|
s.extensions = ['ext/commonmarker/extconf.rb']
|
23
23
|
|
24
24
|
s.test_files = s.files.grep(%r{^test/})
|
data/ext/commonmarker/tasklist.c
CHANGED
@@ -17,7 +17,7 @@ char *cmark_gfm_extensions_get_tasklist_state(cmark_node *node) {
|
|
17
17
|
if (!node || ((int)node->as.opaque != CMARK_TASKLIST_CHECKED && (int)node->as.opaque != CMARK_TASKLIST_NOCHECKED))
|
18
18
|
return 0;
|
19
19
|
|
20
|
-
if ((int)node->as.opaque
|
20
|
+
if ((int)node->as.opaque == CMARK_TASKLIST_CHECKED) {
|
21
21
|
return "checked";
|
22
22
|
}
|
23
23
|
else {
|
@@ -74,7 +74,8 @@ static cmark_node *open_tasklist_item(cmark_syntax_extension *self,
|
|
74
74
|
cmark_node_set_syntax_extension(parent_container, self);
|
75
75
|
cmark_parser_advance_offset(parser, (char *)input, 3, false);
|
76
76
|
|
77
|
-
|
77
|
+
// Either an upper or lower case X means the task is completed.
|
78
|
+
if (strstr((char*)input, "[x]") || strstr((char*)input, "[X]")) {
|
78
79
|
parent_container->as.opaque = (void *)CMARK_TASKLIST_CHECKED;
|
79
80
|
} else {
|
80
81
|
parent_container->as.opaque = (void *)CMARK_TASKLIST_NOCHECKED;
|
data/lib/commonmarker/version.rb
CHANGED
data/test/test_tasklists.rb
CHANGED
@@ -24,4 +24,10 @@ MD
|
|
24
24
|
def test_html_renderer
|
25
25
|
assert_equal @expected, CommonMarker::HtmlRenderer.new.render(@doc)
|
26
26
|
end
|
27
|
+
|
28
|
+
def test_tasklist_state
|
29
|
+
list = @doc.first_child
|
30
|
+
assert_equal 'checked', list.first_child.tasklist_state
|
31
|
+
assert_equal 'unchecked', list.first_child.next.tasklist_state
|
32
|
+
end
|
27
33
|
end
|
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: 0.20.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-04-
|
12
|
+
date: 2019-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-enum
|