martile 0.6.37 → 0.6.38

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce1d725e6741563cb5b00968413be8c8981b71c6
4
- data.tar.gz: 90955ee07ce663269c9e7f5d644fcc15cf575c71
3
+ metadata.gz: cd3eeb5b209ea2dbdfc78c4591177a08ef3b2969
4
+ data.tar.gz: a66e15bc31e24c297912d830eeefdf08889e8a9d
5
5
  SHA512:
6
- metadata.gz: 057427ca9d6a7ff8c9c848a97d3d3a93b911b78ac2aaffd5878676aa006bf7bf206ebb20cf5884157ffad26bb1d8dc669507ec536f1b584f41222739fd224ce9
7
- data.tar.gz: bf200b7e2d78294fae10f2b9f4f1741ed84611a997db81c5e3665d726c4ad1f17cc706ba4eb8fcf7716e85d037e3c9809be6ba0d6e1df3a5e69afae97bbc0c01
6
+ metadata.gz: 5ed12d55ac62cd35e3e6f240013992005dbc6c51584883840665b9ccf396074d54549d4a6b20bb18e0ead66c701ea703c4a44c4121ebd90eee2309eb60195829
7
+ data.tar.gz: d7f6a6430fcb7d32e45feeb187f76b1d4e3d0ea4205a8a3ccbfb2cf61c39a00ee1582737db706878196f66ecdd7c08212f9f219dbb31b23efbfff21d964293bd
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- (>���l�� ��_WTZ�����Y�����_5��4�q�<��(��l٣8(3+ࣾ�j���6�>�8+1��{��+ I��-�1��P���E&�� ��k��k����1�+ �'������$��1�x�C�X���AG�
2
- �2�ᘪPUI��&"����t�e���{�MH<��B[�����9�������=L-�M{�#�� 3CX'Q�Z �xfͦ3��Mݮ
3
- �*�Sg�I��*���%��$�1���o3�
1
+ g��#G��ǵK��l'۪�=I�~�5i"m-����(X��������|c�����*�d$�#t|�tpֶ�ݠe�` ���Dr�Zv%�h� �Y��)p��)W@���#ٞ����1c9��e��w>��%�Ҧ[3o(�$U��ha��I-�G�g��K�����R��
2
+ ��%�/�ZC*$ c���{�t����� ��j����3OB)��M��/f1l���Z\C&�
3
+ ȩ��֯3`#�5_�*�nx��
data.tar.gz.sig CHANGED
Binary file
data/lib/martile.rb CHANGED
@@ -9,8 +9,11 @@ require 'rdiscount'
9
9
  require 'kvx'
10
10
 
11
11
 
12
- # feature: 28-May-2017 Return characters are now stripped out.
13
-
12
+ # feature: 28-May-2017 Within the context of an embedded Dynarex table,
13
+ # the nomarkdown extension was wrapped around the inner HTML for each column
14
+ #
15
+ # Return characters are now stripped out.
16
+ #
14
17
  # An embeded Dynarex table contents are now rendered to
15
18
  # Markdown by default
16
19
  # feature: 11-Mar-2017 A details and summary tag can now be generated from +>
@@ -359,12 +362,13 @@ class Martile
359
362
 
360
363
  def dx_render_table(dx, raw_select)
361
364
 
362
- markdown = true
365
+ markdown, heading = true, true
363
366
 
364
367
  if raw_select then
365
368
  raw_fields = raw_select[/select:\s*["']([^"']+)/,1]
366
369
  fields = raw_fields.split(/\s*,\s*/) if raw_fields
367
370
  markdown = false if raw_select[/\bmarkdown:\s*false\b/]
371
+ heading = false if raw_select[/\bheading:\s*false\b/]
368
372
  end
369
373
 
370
374
  print_row = -> (row, widths) do
@@ -394,7 +398,7 @@ class Martile
394
398
 
395
399
  row.map do |col|
396
400
 
397
- found_match = col.match(/https?:\/\/([^\/]+)(.*)/)
401
+ found_match = col.match(/^https?:\/\/([^\/]+)(.*)/)
398
402
 
399
403
  r = if found_match then
400
404
 
@@ -405,8 +409,17 @@ class Martile
405
409
  url_title = (a.join('.') + path)[0..39] + '...'
406
410
 
407
411
  "[%s](%s)" % [url_title, col]
412
+
408
413
  else
409
- markdown ? RDiscount.new(col).to_html.strip.gsub("\n",'') : col
414
+
415
+ if markdown then
416
+ "{::nomarkdown}" +
417
+ RDiscount.new(col).to_html.strip.gsub("\n",'') + "{:/}"
418
+ else
419
+
420
+ col
421
+
422
+ end
410
423
 
411
424
  end
412
425
 
@@ -415,12 +428,14 @@ class Martile
415
428
  end
416
429
 
417
430
  widths = ([keys] + vals).transpose.map{|x| x.max_by(&:length).length}
418
- th = '|' + keys.join('|') + "|\n"
419
- th = print_row.call(keys, widths)
420
- th_line = print_thline.call widths.map {|x| '-' * (x+1)}, widths
421
-
422
- tb = print_rows.call(vals, widths)
431
+
432
+
433
+ th = heading ? print_row.call(keys, widths) : ''
434
+ th_line = print_thline.call widths.map {|x| '-' * (x+1)}, widths
435
+ tb = print_rows.call(vals, widths)
436
+
423
437
  table = th + th_line + tb
438
+
424
439
  end
425
440
 
426
441
  def unordered_list_to_html(s)
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.37
4
+ version: 0.6.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file