martile 0.6.22 → 0.6.23

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4de5719b825434a16bdc903d24f54e13a6df82df
4
- data.tar.gz: ee68a11eae4c28461b595a8939897306df59feae
3
+ metadata.gz: b6242f62455efceab20f5041c8cba6baade349de
4
+ data.tar.gz: cea9426033ff0576640491108fa00328651ec299
5
5
  SHA512:
6
- metadata.gz: cfa3f4546eebbeba9953afbb8897e9d106bb57dabdf0ab11b9719eb5f2a4f222ec54bafccd1105dc4b1c9fbe620e3eed8863fabd7d9e6848848597869a98e042
7
- data.tar.gz: c095b2f488e72d48a47680bbc216b9f20dfb5239fa22a9382266df43f955c8b8a3cef261be316e54d018ea8e45347ebaf7f4bf627af84ad18b30bfd3ac8137f5
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
- '���.�z?0�bD��ۚA�l�Ϩ<����}��u�@���Oϸ"�$?{�r��s�L�� g�UG��<<�O���D ��\��aŶ����`�a�b܊d�ͶN����`��z�<����G��iwϤ�c�ſXhk��y*�uӄ�fi�!8�{:�[}?��r��cn<�4F���Z*І������L(T4�\M�9Y�Ŏ���&~�8U˜$AD�Gͮ�#m��'��[-��b_z�qQ5p�� Q��j� �
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
- 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
321
+ separator = "\n1449232851\n"
322
+
323
+ a, apre = s.split(/(?=<pre)/).inject([[],[]]) do |r, row|
325
324
 
326
- s2 = blk.call [upper,lower].join(separator)
325
+ pre = nil
327
326
 
328
- s2.split(separator, 2).insert(1, pre).join
329
- else
330
- blk.call row
327
+ s2 = row.sub(/<pre.*<\/pre>/m) do |pattern|
328
+ pre = pattern
329
+ separator
331
330
  end
332
- end.join
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).to_html).to_html
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
@@ -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.22
4
+ version: 0.6.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file