himekami-markdown 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '094e47b827689d146bfd8eb9962fc69c15d287ac'
4
- data.tar.gz: 3965a4adcf0060587375c15e9b8d242e73aadad5
3
+ metadata.gz: fb095bfdf4e1f8a6f093f0a618c86de3ab4a78f3
4
+ data.tar.gz: 76e9223b77dbf14cee327e482b78ada0f56177a4
5
5
  SHA512:
6
- metadata.gz: 5813f9714f8b3b1c35df4a9e022160d189970410e2422a8a3dc49c7b09e7bd2deeae910b9b02c77c08a9979a6c7cf318bad07f1c5f70d9f104e73be59ca785d6
7
- data.tar.gz: 37d3ee27a32ae8b7dda9f94330fcbc432b8c04b531cdbe4e34058a29c653daf1322a9fd337c380e6448cb5a1f3f518e3d7458d5f2167ab8d40f6c16aae7707fb
6
+ metadata.gz: 112cf7a3d7802f298e6e49b943298b2bb05b5ef9fc4ac2ab95662c69c2b43de19c44c286595e2bdad86807ec4bb51f8267dc59691f8b553f7a904a21fbfcde2b
7
+ data.tar.gz: 9a3cbdbdd4c6570cf4002ba6750fe3109c463144fad1c1b654ba13b49379a75ede3ccd1a9341d606099ff6fc55db362941c0be0065c1398d1fb72ab9fd66dfc3
@@ -16,16 +16,14 @@ module Himekami
16
16
  LI_ATTR_CLASS = 'task-list-item'.freeze
17
17
  CHECKBOX_ATTR_CLASS = 'task-list-item-checkbox'.freeze
18
18
 
19
- CHECKBOX_OPEN = "[ ]".freeze
20
- CHECKBOX_CLOSED = "[x]".freeze
19
+ CHECKBOX_OPEN = "[ ] ".freeze
20
+ CHECKBOX_CLOSED = "[x] ".freeze
21
21
 
22
- CHECKBOX_OPEN_PATTERN = /\[ \]/
23
- CHECKBOX_CLOSED_PATTERN = /\[x\]/
24
- CHECKBOX_PATTERN = /(#{CHECKBOX_OPEN_PATTERN}|#{CHECKBOX_CLOSED_PATTERN})/
22
+ CHECKBOX_PATTERN = /(\[ \]|\[x\])\s+/
25
23
 
26
24
  class << self
27
25
  def has_checkbox?(node)
28
- node.text =~ CHECKBOX_PATTERN
26
+ node.text.start_with?(CHECKBOX_OPEN, CHECKBOX_CLOSED)
29
27
  end
30
28
  end
31
29
 
@@ -71,7 +69,7 @@ module Himekami
71
69
  end
72
70
 
73
71
  def open_checkbox?
74
- text_node.content.include?(CHECKBOX_OPEN)
72
+ text_node.content.start_with?(CHECKBOX_OPEN)
75
73
  end
76
74
  end
77
75
  end
@@ -1,5 +1,5 @@
1
1
  module Himekami
2
2
  module Markdown
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: himekami-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - otukutun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-03 00:00:00.000000000 Z
11
+ date: 2017-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.5.2
167
+ rubygems_version: 2.6.11
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Project himekami markdown parser.