parity-RedCloth 4.2.11 → 4.2.12
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
- data/lib/redcloth/formatters/html.rb +7 -1
- data/lib/redcloth/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 532ead9fc1ffda2848c8a3b81c6219d32b3a9855
|
|
4
|
+
data.tar.gz: f4e46b78782c336753b1fab6aa0ff80ae1d995da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c4690a6d1f94b8338936a433378d15a085f881c8d1463b83f1b9862abb54bff6657e03ad59c7953423878cd260e57c228d51df45e7417993da38ae36311cd48
|
|
7
|
+
data.tar.gz: f703240d32eb998eca86d9465acc2b553d76672d952f060b91c6755467943266fca085bffa36645ee4f63f01f0f6cb698beb0811a16c0cb200bd8538b0089a5d
|
|
@@ -114,12 +114,18 @@ module RedCloth::Formatters::HTML
|
|
|
114
114
|
"<a href=\"#{escape_attribute opts[:href]}\"#{pba(opts)}>#{opts[:name]}</a>"
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
+
def truncate(text, length = 30, truncate_string = "...")
|
|
118
|
+
if text.nil? then return end
|
|
119
|
+
l = length - truncate_string.chars.to_a.size
|
|
120
|
+
(text.chars.to_a.size > length ? text.chars.to_a[0...l].join + truncate_string : text).to_s
|
|
121
|
+
end
|
|
122
|
+
|
|
117
123
|
def auto_link(opts)
|
|
118
124
|
return opts[:href] unless auto_link_urls
|
|
119
125
|
href_with_proto = opts[:href]
|
|
120
126
|
href_with_proto = 'http://' + href_with_proto unless href_with_proto.index('http') == 0
|
|
121
127
|
text = opts[:href]
|
|
122
|
-
text = text[0,
|
|
128
|
+
text = truncate(text[0, text.length - 6] + text[-5,3].replace("...") + text[-2..-1], 50)
|
|
123
129
|
"<a href=\"#{escape_attribute href_with_proto}\">#{escape_attribute text}</a>"
|
|
124
130
|
end
|
|
125
131
|
|
data/lib/redcloth/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parity-RedCloth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.2.
|
|
4
|
+
version: 4.2.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Garber
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2015-
|
|
14
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -203,7 +203,7 @@ rubyforge_project: redcloth
|
|
|
203
203
|
rubygems_version: 2.2.1
|
|
204
204
|
signing_key:
|
|
205
205
|
specification_version: 4
|
|
206
|
-
summary: RedCloth-4.2.
|
|
206
|
+
summary: RedCloth-4.2.12
|
|
207
207
|
test_files:
|
|
208
208
|
- spec/benchmark_spec.rb
|
|
209
209
|
- spec/custom_tags_spec.rb
|