jekyll-img-converter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-img-converter.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b00a406b9d6b2ab3f5a86f9b2387b090a84f4bf7
|
4
|
+
data.tar.gz: 2f7203597e1f7d361557bf619118137599884352
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a9e5f06a4cd7ff81e65f2ee7b4ec502a1d86ec3b610aff9a054c49ca7c7afba2c56f7ef87fb9fe54e16728ada07d762135100243068d2388187ed5536d4393
|
7
|
+
data.tar.gz: 402a0939a2e430ca2ed0e0912af1e5c48f86f5e5daf829d3814a888493b9e0e3420c9ae6f1541b02cc7e00db2faa0a7c88c0a9effe63d5b2f2324c1e129c1bdb
|
data/lib/jekyll-img-converter.rb
CHANGED
@@ -9,17 +9,19 @@ module Jekyll
|
|
9
9
|
# content &&= content
|
10
10
|
pattern = /({)(.+)(})/
|
11
11
|
matchData = pattern.match(content)
|
12
|
-
|
13
|
-
|
12
|
+
|
14
13
|
imgTag = "<img src=\"#{link}\""
|
14
|
+
|
15
15
|
if (matchData)
|
16
|
-
|
16
|
+
style = matchData[0]
|
17
|
+
stripContent = content.gsub(style,'')
|
18
|
+
imgTag += " alt=\"#{stripContent}\" style=\"#{style}\""
|
17
19
|
else
|
18
|
-
imgTag
|
20
|
+
imgTag += " alt=\"#{content}\""
|
19
21
|
end
|
20
22
|
|
21
23
|
if(title)
|
22
|
-
imgTag
|
24
|
+
imgTag += " title=\"#{title}\""
|
23
25
|
end
|
24
26
|
|
25
27
|
imgTag = imgTag + "/>"
|