martile 0.6.22 → 0.6.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -1
- data/lib/martile.rb +29 -16
- metadata +1 -1
- 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: b6242f62455efceab20f5041c8cba6baade349de
|
4
|
+
data.tar.gz: cea9426033ff0576640491108fa00328651ec299
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05b999ec27c33fd04590755ef0c20fbda05fdb635d9993ca9d65acf7557f6d88f45e2c5419a7d6a80cce19dd16ef8f983c407234af1c107f52341568e96c09b7
|
7
|
+
data.tar.gz: c3535cde31d823ed6151b088c59b3459b2ff01e7a4d767353ba8798ac2af3eada06ed65c1cec20f4b29aa54e787bebf03316f95ed34f071c76729989adbba495
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
$ ��}
|
2
|
+
��0b�:�`�3�Q�&�j %�ǒ�5����� g�C��&��1�hG\핗�o&�#���?|��<ޫ
|
data/lib/martile.rb
CHANGED
@@ -9,6 +9,10 @@ require 'rdiscount'
|
|
9
9
|
require 'kvx'
|
10
10
|
|
11
11
|
|
12
|
+
# bug fix: 05-Dec-2015 PRE tags are now correctly filtered out using the
|
13
|
+
# apply_filter() method.
|
14
|
+
# the ignore_domainlabel keword is now supplied to the
|
15
|
+
# Martile.new statement within the section() method
|
12
16
|
# bug fix: 04-Dec-2015 apply_filter() now masks over <pre> tags rather than
|
13
17
|
# splitting them and passing them to the block
|
14
18
|
# bug fix: 03-Dec-2015 A smartlink which ends with a closing parenthesis is
|
@@ -312,28 +316,35 @@ class Martile
|
|
312
316
|
|
313
317
|
end
|
314
318
|
|
315
|
-
|
316
319
|
def apply_filter(s, names=%w(pre code), &blk)
|
317
320
|
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
lower = row[/<\/pre>(.*)/m,1]
|
322
|
-
pre = row[/<pre>.*<\/pre>/m]
|
323
|
-
|
324
|
-
if pre then
|
321
|
+
separator = "\n1449232851\n"
|
322
|
+
|
323
|
+
a, apre = s.split(/(?=<pre)/).inject([[],[]]) do |r, row|
|
325
324
|
|
326
|
-
|
325
|
+
pre = nil
|
327
326
|
|
328
|
-
|
329
|
-
|
330
|
-
|
327
|
+
s2 = row.sub(/<pre.*<\/pre>/m) do |pattern|
|
328
|
+
pre = pattern
|
329
|
+
separator
|
331
330
|
end
|
332
|
-
|
331
|
+
|
332
|
+
r.first << s2
|
333
|
+
r.last << pre if pre
|
334
|
+
r
|
335
|
+
|
336
|
+
end
|
337
|
+
|
338
|
+
r2 = blk.call a.join
|
339
|
+
|
340
|
+
apre.compact.each do |x|
|
341
|
+
r2.sub!(separator, x)
|
342
|
+
end
|
343
|
+
|
344
|
+
r2
|
333
345
|
|
334
346
|
end
|
335
|
-
|
336
|
-
|
347
|
+
|
337
348
|
def explicit_list_to_html(s)
|
338
349
|
|
339
350
|
match = s.match(/<([ou]l)>([\*#])/m)
|
@@ -529,9 +540,11 @@ class Martile
|
|
529
540
|
if r.last.length > 0 and r.last.first[/<section/] then
|
530
541
|
|
531
542
|
list = r.pop
|
543
|
+
|
532
544
|
r << ["%s%s</section>" %
|
533
545
|
[list[0], \
|
534
|
-
RDiscount.new(Martile.new(list[1..-1].join
|
546
|
+
RDiscount.new(Martile.new(list[1..-1].join, \
|
547
|
+
ignore_domainlabel: @ignore_domainlabel).to_html).to_html
|
535
548
|
]
|
536
549
|
]
|
537
550
|
r << []
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|