martile 0.6.32 → 0.6.33

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: 9f2923ea96d408824def1ebffedd006f6f5e1a60
4
- data.tar.gz: 7c870c715b34ef66dce979418fad4198a443c2b7
3
+ metadata.gz: eea27e4f2401deef0ba6d81682194045c8a97970
4
+ data.tar.gz: 3e164394c7bbad9fc1dbd3f1650c3002683d276c
5
5
  SHA512:
6
- metadata.gz: 7f5e18ef28c75eab6bac5d79f0f1d21c927d18c2b91ca9167c891b6c0b561c069b2693cc5d2d3aafe767339cd1be49a2ef4750ae095b251b49ef7ad7e5e3776b
7
- data.tar.gz: fa842dfcc0e79e25c688c242cf9ffd407dfeffac7da600e458bd0b174ce0ab0900366712c426c0dae35e7469974dc1cecc7af88ee2424258bdd47f6835f9b323
6
+ metadata.gz: c415aa63e8d2436fa6244666bb21be027a653d039e9cc512cd5773689f2faf9605d78bbc5e42abcdfa5a8c0d94d58eab69eb735c7a27c6fe70bfedfc4d917fe3
7
+ data.tar.gz: 637d4fa657c91394e651b892fa98ec6d4e81769a3cbeee2825db3236f05e45c670b47e26c82a5cc6d9b1e4fe2a0ad4bd8123814cce4a857c6ae839e088650460
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
+ # minor feature:
13
+ # 9-Feb-2017 implemented a shorthand (^) for the mark tag
12
14
  # minor feature:
13
15
  # 3-Feb-2017 a video smartlink can now include options e.g. loop: true
14
16
  # bug fix: 29-Jan-2017 2 or more code listings should now be parsed correctly
@@ -22,47 +24,7 @@ require 'kvx'
22
24
  # syntax instead of -[]
23
25
  # bug fix: 29-Feb-2016 Arbitrary URLs will no longer automatically
24
26
  # be hyperlinked
25
- # bug fix: 05-Dec-2015 PRE tags are now correctly filtered out using the
26
- # apply_filter() method.
27
- # the ignore_domainlabel keword is now supplied to the
28
- # Martile.new statement within the section() method
29
- # bug fix: 04-Dec-2015 apply_filter() now masks over <pre> tags rather than
30
- # splitting them and passing them to the block
31
- # bug fix: 03-Dec-2015 A smartlink which ends with a closing parenthesis is
32
- # now output to a regular anchor tag
33
- # It should now identify when using a section equals sign
34
- # to terminate a section block
35
- # The content of a section block can now be processed
36
- # using the Martile object recursively
37
- # bug fix: 22-Oct-2015 The method apply_filter() is now used
38
- # with the section() method
39
- # feature: 10-Oct-2015 A hyperlink can now be create from a
40
- # list item containing a URL
41
- # bug fix: 06-Oct-2015 Can now handle multiple smart links on the same line
42
- # bug fix: 17-Aug-2015 dx_render_table() was missing a couple of parameters
43
- # feature: 09-Aug-2015 kvx_to_dl() can convert a kind of
44
- # markdown URL to a DL HTML list
45
- # feature: 02-Aug-2015 dynarex_to_table() is now know as dynarex_to_markdown()
46
- # A markdown list will be rendered from a Dynarex
47
- # document if there is only a single field column
48
- # improvement:
49
- # 16-Jul-2015 to_s is now equivalent to_html; to_s is
50
- # more readable when it's just text which is returned
51
- # feature: 06-Jul-2015 dynarex_to_markdown():
52
- # 1. A URL within a col is now hyperlinked
53
- # 2. Select fields can now be displayd
54
- # feature: 02-Jul-2015 Apply_filter() now filters out pre and code tags
55
- # The shorthand !i[]() can now render an iframe tag
56
- # e.g. !i[](http://somefile.url/sometext.txt)
57
- # feature: 19-Jun-2015 Now uses github flavoured markdown to style the table
58
- # 01-Jun-2015 re-applied yesterday's feature which I
59
- # removed shortly afterwards
60
- # feature: 31-May-2015: Transforms a kind-of markdown URL to an audio tag
61
- # e.g. !a[](http://someurl) transforms to ). Transforms a kind-of
62
- # markdown URL to an video tag e.g. !v[](http://someurl) transforms to )
63
- # bug fix: The inner Martile call within a Section now
64
- # ignores domain labels to avoid duplication of URL scanning.
65
- # feature: 29-Mar-2015: Borrowed the strikethru feature from Mtlite
27
+
66
28
 
67
29
 
68
30
  class Martile
@@ -120,9 +82,11 @@ class Martile
120
82
  #puts 's16 : ' + s16.inspect
121
83
  s17 = apply_filter(s16) {|x| mtlite_utils x }
122
84
  s18 = apply_filter(s17) {|x| hyperlinkify x }
85
+ s19 = apply_filter(s18) {|x| highlight x }
86
+
123
87
  #puts 's17 : ' + s17.inspect
124
88
 
125
- @to_s = s18
89
+ @to_s = s19
126
90
  end
127
91
 
128
92
  def to_html()
@@ -478,6 +442,12 @@ class Martile
478
442
 
479
443
  end
480
444
 
445
+ def highlight(s)
446
+
447
+ s.gsub(/\^[^\^]+\^/) {|x| "<mark>%s</mark>" % x[1..-2] }
448
+
449
+ end
450
+
481
451
  def smartlink(s)
482
452
 
483
453
  s.split(/(?= \?)/).inject('') do |r, substring|
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.32
4
+ version: 0.6.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  fHJRwdYS8tvLYH9UFytJxDKjlovBuFUsfKP0FJlZGQGJM5JiIj5LWelTGJtJD8hI
32
32
  2jPlwrOtiqZt2A==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-02-03 00:00:00.000000000 Z
34
+ date: 2017-02-09 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdiscount
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- �==�HV��8x��-:�#m�ɐ�ԑ�(p8
2
- &�nQ �O�AȄ���B��P�� � "N��JQQJ�)���Jz��En��,w|��[*���˕��� �CEkt܌�39�(���,)�i�d�Y +�d��?���F�({|��G��o���x��W��^dq����|p6X�tёZ-�ܿ�U�cͣ�,�Ɣ�r�����#Җ{���`L9IX(�$�G�QhFv��t_ `&��3W-F��n�O&�V
1
+ CM%+1ǖ3��F;�"[���w��RD� ���}A4H�"�K? �Q_m.��A�������Z���I΀ۺ$�4�Ax?9`lF�k����;@u���d��h.����NKӰ����<D���HKLq���R���mS�8����r���a��
2
+ �� ���f5n����]��-�߂J,�=Fȷ�1R�h2ح I��퉱�F8hv4��-�\e��06^�\� jX��By�t�"ڛ�5��n�����[��