mtlite 0.2.0 → 0.2.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mtlite.rb +6 -3
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 5529ac3a35870bf548ea0fb56daf072b6105d8d0
|
4
|
+
data.tar.gz: 1a69be5c488d6789302667bea14f391befcef2cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cefbc078d177f86165932a4272fdd01156e2d4da5782e107a3520a68897ae28d79c60a52ae391b1f4e8ec84f6b7aa9dc7d1de304ca778503b17555619dc0d18e
|
7
|
+
data.tar.gz: fee905fd70a170fb10d91a9b406954cb1c853fd991b91ec49ea2f7b16a37db828bf8a346113803e802a1ec6d20a41a622d0667e28e77aa0ae84c20851f6b13a7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mtlite.rb
CHANGED
@@ -8,11 +8,13 @@ class MTLite
|
|
8
8
|
|
9
9
|
def initialize(raw_msg)
|
10
10
|
|
11
|
-
@
|
11
|
+
@raw_msg = raw_msg
|
12
12
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def to_html()
|
16
|
+
|
17
|
+
raw_msg = @raw_msg.clone
|
16
18
|
# if it looks like an MtLite list make it an MtLite list
|
17
19
|
# e.g. "a todo list:\n* line 1\n* line 2" =>
|
18
20
|
# a todo list: [* line 1 * line 2]
|
@@ -69,6 +71,7 @@ class MTLite
|
|
69
71
|
msg.gsub!(/(?:^(https?:[^\s]+)|\s(https?:[^\s]+))/,' <a href="\2">\2</a>')
|
70
72
|
# add the target attribute to make all hyperlinks open in a new browser tab
|
71
73
|
msg.gsub!(/<a /,'<a target="_blank" ')
|
74
|
+
@msg = msg
|
72
75
|
|
73
76
|
end
|
74
77
|
|
@@ -78,7 +81,7 @@ class MTLite
|
|
78
81
|
|
79
82
|
def to_s
|
80
83
|
|
81
|
-
msg = @
|
84
|
+
msg = @raw_msg.clone
|
82
85
|
|
83
86
|
# remove markdown hyperlink markings
|
84
87
|
msg.sub!(/\[([^\]]+)\]\(([^\)]+)\)/, '\1 \2')
|
@@ -98,7 +101,7 @@ class MTLite
|
|
98
101
|
|
99
102
|
end
|
100
103
|
|
101
|
-
msg.gsub('<br/>',"\n").gsub(/<\/?.[^>]*>/,'')
|
104
|
+
@msg = msg.gsub('<br/>',"\n").gsub(/<\/?.[^>]*>/,'')
|
102
105
|
end
|
103
106
|
|
104
107
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|