Fix all rubocop warnings
This commit is contained in:
parent
05e39dc619
commit
bf851133ae
48 changed files with 124 additions and 97 deletions
|
@ -64,7 +64,7 @@ class TextFormatter
|
|||
indices.last
|
||||
end
|
||||
|
||||
result << h(text[last_index..-1])
|
||||
result << h(text[last_index..])
|
||||
|
||||
result
|
||||
end
|
||||
|
@ -75,8 +75,8 @@ class TextFormatter
|
|||
|
||||
prefix = url.match(URL_PREFIX_REGEX).to_s
|
||||
display_url = url[prefix.length, 30]
|
||||
suffix = url[prefix.length + 30..-1]
|
||||
cutoff = url[prefix.length..-1].length > 30
|
||||
suffix = url[prefix.length + 30..]
|
||||
cutoff = url[prefix.length..].length > 30
|
||||
|
||||
<<~HTML.squish
|
||||
<a href="#{h(url)}" target="_blank" rel="#{rel.join(' ')}"><span class="invisible">#{h(prefix)}</span><span class="#{cutoff ? 'ellipsis' : ''}">#{h(display_url)}</span><span class="invisible">#{h(suffix)}</span></a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue