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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ddd9dac2dc959a7d2c4297934501575ab3451594
4
- data.tar.gz: f8d6defe22a3e3bcf16c20bd5d6403bdae7555e1
3
+ metadata.gz: 237799ebff0e881aabc44799deac5c31a201307b
4
+ data.tar.gz: c2ebbe9b5bf5cc3ff8cb218c92a280eeb6aca70f
5
5
  SHA512:
6
- metadata.gz: 0ea4f88fe4b6c81f70ecde02d26897bfc12b84dde2275becadf85121cdf07be48796fc028537656345c64dea903371703aa233c00071c18e496aa204d3702788
7
- data.tar.gz: '08413704c3d74d6f5148aa64dbebce1d66ab313494656d0ea0015cd99c9cbb5707398678d68cf70ad324a93820faf0dda0d1ae13efda5083e69a4a3ac7dba3bd'
6
+ metadata.gz: 2d5122a6869dc1b0e112a7ca8afcadfc53fda72c75f5bc0486e7046e59094f67f72f80955af1cc5fd6604ecea76361ee511c124b47f1c66f3f01496cf5a6b6ad
7
+ data.tar.gz: 39f7183d9f048c72729a916cefca93fecdc55e95054ff019fdeddc2ad94be5dbeb61c2c4ef7175373a0c2d520a72ad3743e415700bcbade0eb5dcdc37443ed16
@@ -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/})
@@ -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 != CMARK_TASKLIST_CHECKED) {
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
- if (strstr((char*)input, "[x]")) {
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;
@@ -1,6 +1,4 @@
1
1
  # frozen_string_literal: true
2
- # rubocop:disable Standard/RailsViewRenderLiteral
3
- # rubocop:disable Standard/RailsControllerRenderLiteral
4
2
 
5
3
  require 'set'
6
4
  require 'stringio'
@@ -72,9 +72,9 @@ module CommonMarker
72
72
  def tasklist(node)
73
73
  return '' unless tasklist?(node)
74
74
  state = if checked?(node)
75
- 'disabled=""'
76
- else
77
75
  'checked="" disabled=""'
76
+ else
77
+ 'disabled=""'
78
78
  end
79
79
  return "><input type=\"checkbox\" #{state} /"
80
80
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommonMarker
4
- VERSION = '0.20.0'.freeze
4
+ VERSION = '0.20.1'.freeze
5
5
  end
@@ -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.0
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-09 00:00:00.000000000 Z
12
+ date: 2019-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-enum