martile 0.6.20 → 0.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/martile.rb +21 -17
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a04824f656a9911978b8ebf4746987f7d264832
|
4
|
+
data.tar.gz: 2b66c0d44b85c1d9f45715f8f0821ab575ede2b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3023d74494103af8fb64241aad246202a282671977107df374d44435c33f2b467b7c102b2d42800727efccf84b4269ba66088854f8c028feeee86f7cf805c0f1
|
7
|
+
data.tar.gz: d13c73afbf8afb0d7737666ff130bb1c0ebb004d7d3fa22691dd1db87a357eeb1cdc1414899432b01c67ead615fadaa1fe814c29639448aa5adce0c9228bf7ae
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/martile.rb
CHANGED
@@ -9,6 +9,8 @@ require 'rdiscount'
|
|
9
9
|
require 'kvx'
|
10
10
|
|
11
11
|
|
12
|
+
# bug fix: 04-Dec-2015 apply_filter() now masks over <pre> tags rather
|
13
|
+
# splitting them and passing them to the block
|
12
14
|
# bug fix: 03-Dec-2015 A smartlink which ends with a closing parenthesis is
|
13
15
|
# now output to a regular anchor tag
|
14
16
|
# It should now identify when using a section equals sign
|
@@ -118,9 +120,9 @@ class Martile
|
|
118
120
|
s2 = code_block_to_html(s.strip + "\n")
|
119
121
|
|
120
122
|
#puts 's2 : ' + s2.inspect
|
121
|
-
s3 = apply_filter(s2, %w(ol ul)) {|x| explicit_list_to_html x }
|
123
|
+
#s3 = apply_filter(s2, %w(ol ul)) {|x| explicit_list_to_html x }
|
122
124
|
#puts 's3 : ' + s3.inspect
|
123
|
-
s4 = apply_filter(
|
125
|
+
s4 = apply_filter(s2) {|x| ordered_list_to_html x }
|
124
126
|
#puts 's4 : ' + s4.inspect
|
125
127
|
|
126
128
|
s5 = apply_filter(s4) {|x| unordered_list_to_html x }
|
@@ -310,26 +312,28 @@ class Martile
|
|
310
312
|
|
311
313
|
end
|
312
314
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
315
|
+
|
316
|
+
def apply_filter(s, names=%w(pre code), &blk)
|
317
|
+
|
318
|
+
s.split(/(?=<pre)/).map do |row|
|
319
|
+
separator = "\n1449232851\n"
|
320
|
+
upper = row[/.*(?=<pre>)/m]
|
321
|
+
lower = row[/<\/pre>(.*)/m,1]
|
322
|
+
pre = row[/<pre>.*<\/pre>/m]
|
323
|
+
|
324
|
+
if pre then
|
318
325
|
|
319
|
-
|
320
|
-
|
326
|
+
s2 = blk.call [upper,lower].join(separator)
|
327
|
+
|
328
|
+
s2.split(separator, 2).insert(1, pre).join
|
321
329
|
else
|
322
|
-
|
323
|
-
|
324
|
-
block.call(x.xml pretty: false)
|
325
|
-
else
|
326
|
-
x
|
327
|
-
end
|
328
|
-
|
329
|
-
end
|
330
|
+
blk.call row
|
331
|
+
end
|
330
332
|
end.join
|
333
|
+
|
331
334
|
end
|
332
335
|
|
336
|
+
|
333
337
|
def explicit_list_to_html(s)
|
334
338
|
|
335
339
|
match = s.match(/<([ou]l)>([\*#])/m)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: martile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
fnr5l+RI/6f8lfxBNgDrktGB/RwPkOyWtyKk1tu9CWgHmptxL0JglikCXg5MzuZI
|
32
32
|
tZzXOvXUoUf1VQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-12-
|
34
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rdiscount
|
metadata.gz.sig
CHANGED
Binary file
|