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 +4 -4
- data/lib/himekami/markdown/filters/checkbox.rb +5 -7
- data/lib/himekami/markdown/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb095bfdf4e1f8a6f093f0a618c86de3ab4a78f3
|
4
|
+
data.tar.gz: 76e9223b77dbf14cee327e482b78ada0f56177a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.
|
72
|
+
text_node.content.start_with?(CHECKBOX_OPEN)
|
75
73
|
end
|
76
74
|
end
|
77
75
|
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
|
+
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-
|
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.
|
167
|
+
rubygems_version: 2.6.11
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: Project himekami markdown parser.
|