mtlite 0.3.4 → 0.3.5

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: 77c584b398a54f15b341ab6842f423024809243a
4
- data.tar.gz: dbc27ed44191928e6a99e8d5880c992980b29c75
3
+ metadata.gz: 9e1a70674c3665a7cdf8cf8922d3f1856317efc3
4
+ data.tar.gz: a03e654bcf91c58b004b3247716243d158233cb5
5
5
  SHA512:
6
- metadata.gz: 47636e653b56e71ae2a12320f8841d08bdc890e4b8b406eac1ffed60457a013900e9f8541ecf55a4d89124d1664b11e00f3c8c617e40f90de2ec4fc09e776135
7
- data.tar.gz: eb502b3b7e2d2aaa0e7de57df15e390d30dba69f89224fde6dd8e91a08503dedf959f4adddfb1607ae8babc7d303a2fdc002a87b3285e7f8dafe59562d9b9552
6
+ metadata.gz: fc65f5ea9994c71d76c5889aa9acf14d72b3c26b9eedc58e07c75c2a62f614643a54b14a1293c31ff2d9dc903aa9df0f1547fb8433ab4030c88080e4f8219e46
7
+ data.tar.gz: 629aaf3e00a2982e233b6cf5cdf0fdfb3920e07575ae1d8ea3285266874b61772f8a81758256015b745c558ac1198b420753c78a6a1ebad57f4a2bdc60d38af2
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -19,7 +19,7 @@ class MTLite
19
19
 
20
20
  end
21
21
 
22
- def to_html()
22
+ def to_html(para: false, ignore_domainlabel: false)
23
23
 
24
24
  raw_msg = @raw_msg.clone
25
25
  # if it looks like an MtLite list make it an MtLite list
@@ -50,11 +50,15 @@ class MTLite
50
50
  x.sub(/-([&\w]+.*\w+)-/,'<del>\1</del>')
51
51
  end
52
52
 
53
- # append a domain label after the URL
54
- raw_msg.gsub!(/(?:^\[|\s\[)[^\]]+\]\((https?:\/\/[^\s]+)/) do |x|
55
- s2 = x[/https?:\/\/([^\/]+)/,1].split(/\./)
56
- r = s2.length >= 3 ? s2[1..-1] : s2
57
- "%s [%s]" % [x, r.join('.')]
53
+ unless ignore_domainlabel then
54
+
55
+ # append a domain label after the URL
56
+ raw_msg.gsub!(/(?:^\[|\s\[)[^\]]+\]\((https?:\/\/[^\s]+)/) do |x|
57
+ s2 = x[/https?:\/\/([^\/]+)/,1].split(/\./)
58
+ r = s2.length >= 3 ? s2[1..-1] : s2
59
+ "%s [%s]" % [x, r.join('.')]
60
+ end
61
+
58
62
  end
59
63
 
60
64
  # generate html lists from mtlite 1-liner lists
@@ -74,7 +78,8 @@ class MTLite
74
78
 
75
79
  end
76
80
 
77
- msg = RDiscount.new(raw_msg).to_html.gsub(/<\/?p[^>]*>/,'')
81
+ msg = RDiscount.new(raw_msg).to_html
82
+ msg.gsub!(/<\/?p[^>]*>/,'') unless para
78
83
 
79
84
  regex = %r([\w\-/?=.#\(\)]+)
80
85
  # generate anchor tags for URLs which don't have anchor tags
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  yMXG+gmoKjQ9Nj78V3XSYeIBpqUpfAcg1xXWjuUlnTRdXzfP6h6KkAqi1WL3bdWW
32
32
  XrDeFDCesajwgg==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-07-01 00:00:00.000000000 Z
34
+ date: 2017-07-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