mtlite 0.2.4 → 0.2.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/lib/mtlite.rb +12 -4
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8418abec74afad46dd33ff2c87b8a489bd6e9dbc
|
4
|
+
data.tar.gz: bb7ee11cf35c3a306900da6712a8884b7688a8d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a137949afc8c23d1ec49daaab7e10a9492f8193014c159ffa28651fbab2c4f18295b80b69e18630aad0e0368f148430a7a73a507df6bde8da9f553b2ebed5eb
|
7
|
+
data.tar.gz: 36359938b0eb15efb76fb8a68f7eeb3b3859c1143ca30a085b1cf195b9641fb0ec3ee54d5c121875f69e9361d2e6091d9cf12fa637b5b162bcf840a93b713e57
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mtlite.rb
CHANGED
@@ -8,10 +8,8 @@ class MTLite
|
|
8
8
|
|
9
9
|
def initialize(raw_msg)
|
10
10
|
|
11
|
-
# make the smartlinks into Markdown links
|
12
|
-
raw_msg
|
13
|
-
|
14
|
-
@raw_msg = raw_msg
|
11
|
+
# make the smartlinks into Markdown links
|
12
|
+
@raw_msg = smartlink(raw_msg)
|
15
13
|
|
16
14
|
end
|
17
15
|
|
@@ -107,5 +105,15 @@ class MTLite
|
|
107
105
|
|
108
106
|
@msg = msg.gsub('<br/>',"\n").gsub(/<\/?.[^>]*>/,'')
|
109
107
|
end
|
108
|
+
|
109
|
+
private
|
110
|
+
|
111
|
+
def smartlink(s)
|
112
|
+
|
113
|
+
s.gsub(/\B\?([^\n]+) +(https?:\/\/.*\?)(?=\B)/) do
|
114
|
+
"[%s](%s)" % [$1, ($2).chop]
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
110
118
|
|
111
119
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
���*���{F5=�6�H��,X�{h!�����F�p��Ƙ�\���k�e��uYoVu~�+p�� 1��DA���ƘQh�>���zx%݀=q�j���X�P�L�rsP��&�O@x&���" �'�[y|A%�s����@F�j�Z� 3ؔVg-�m,�OtKpKZ [�u0��A�@±<����Y>�g��
|
1
|
+
ԍf��63b�^�6pnt�H�'/s�j�
|