legal_markdown 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
@@ -82,12 +82,13 @@ module LegalToMarkdown
|
|
82
82
|
def string_guard strings
|
83
83
|
strings.scan(/\:(\S.*)$/){ |m| strings = strings.gsub( m[0], " " + m[0] ) }
|
84
84
|
strings.scan(/^((level-\d+:)(.+)\"*)$/) do |m|
|
85
|
-
line = m[0]; level = m[1]; field = m[2]
|
86
|
-
if field
|
87
|
-
strings = strings.gsub(line, level + " " + field
|
85
|
+
line = m[0]; level = m[1]; field = m[2].strip.delete "\""
|
86
|
+
if field =~ /[^\.\)]\z/
|
87
|
+
strings = strings.gsub(line, level + " \"" + field + ".\"")
|
88
|
+
else
|
89
|
+
strings = strings.gsub(line, level + " \"" + field + "\"")
|
88
90
|
end
|
89
91
|
end
|
90
|
-
strings.scan(/(:\s*(\d+\.))$/){ |m| strings = strings.gsub( m[0], ": \"" + m[1] + "\"" ) }
|
91
92
|
strings
|
92
93
|
end
|
93
94
|
end
|
@@ -99,7 +99,7 @@ class MakeYamlFrontMatter
|
|
99
99
|
if $2
|
100
100
|
arr << "level-" + $2.length.to_s
|
101
101
|
else
|
102
|
-
arr << "level-" + $&.delete("l")
|
102
|
+
arr << "level-" + $&.delete("l").delete(".")
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
@@ -124,12 +124,13 @@ class MakeYamlFrontMatter
|
|
124
124
|
def guard_strings strings
|
125
125
|
strings.scan(/\:(\S.*)$/){ |m| strings = strings.gsub( m[0], " " + m[0] ) }
|
126
126
|
strings.scan(/^((level-\d+:)(.+)\"*)$/) do |m|
|
127
|
-
line = m[0]; level = m[1]; field = m[2]
|
128
|
-
if field
|
129
|
-
strings = strings.gsub(line, level + " " + field
|
127
|
+
line = m[0]; level = m[1]; field = m[2].strip.delete "\""
|
128
|
+
if field =~ /[^\.\)]\z/
|
129
|
+
strings = strings.gsub(line, level + " \"" + field + ".\"")
|
130
|
+
else
|
131
|
+
strings = strings.gsub(line, level + " \"" + field + "\"")
|
130
132
|
end
|
131
133
|
end
|
132
|
-
strings.scan(/(:\s*(\d+\.))$/){ |m| strings = strings.gsub( m[0], ": \"" + m[1] + "\"" ) }
|
133
134
|
strings
|
134
135
|
end
|
135
136
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legal_markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paint
|
@@ -219,7 +219,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
219
219
|
version: '0'
|
220
220
|
segments:
|
221
221
|
- 0
|
222
|
-
hash:
|
222
|
+
hash: -603807181232007624
|
223
223
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
224
|
none: false
|
225
225
|
requirements:
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
segments:
|
230
230
|
- 0
|
231
|
-
hash:
|
231
|
+
hash: -603807181232007624
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
234
|
rubygems_version: 1.8.25
|