mtlite 0.3.4 → 0.3.5
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 +0 -0
- data/lib/mtlite.rb +12 -7
- metadata +2 -2
- 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: 9e1a70674c3665a7cdf8cf8922d3f1856317efc3
|
4
|
+
data.tar.gz: a03e654bcf91c58b004b3247716243d158233cb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc65f5ea9994c71d76c5889aa9acf14d72b3c26b9eedc58e07c75c2a62f614643a54b14a1293c31ff2d9dc903aa9df0f1547fb8433ab4030c88080e4f8219e46
|
7
|
+
data.tar.gz: 629aaf3e00a2982e233b6cf5cdf0fdfb3920e07575ae1d8ea3285266874b61772f8a81758256015b745c558ac1198b420753c78a6a1ebad57f4a2bdc60d38af2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/mtlite.rb
CHANGED
@@ -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
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
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
|
+
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-
|
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
|