Fix empty link replacement
This commit is contained in:
parent
f27bc63d9d
commit
fdd71946da
|
@ -63,10 +63,11 @@ proc linkifyText*(text: string; prefs: Prefs): string =
|
|||
result = result.replace(twRegex, prefs.replaceTwitter)
|
||||
|
||||
proc replaceUrl*(url: string; prefs: Prefs): string =
|
||||
result = url
|
||||
if prefs.replaceYouTube.len > 0:
|
||||
return url.replace(ytRegex, prefs.replaceYouTube)
|
||||
result = url.replace(ytRegex, prefs.replaceYouTube)
|
||||
if prefs.replaceTwitter.len > 0:
|
||||
return url.replace(twRegex, prefs.replaceTwitter)
|
||||
result = url.replace(twRegex, prefs.replaceTwitter)
|
||||
|
||||
proc stripTwitterUrls*(text: string): string =
|
||||
result = text
|
||||
|
|
|
@ -44,7 +44,7 @@ const prefList*: Table[string, seq[Pref]] = {
|
|||
defaultState: false),
|
||||
|
||||
Pref(kind: checkbox, name: "autoplayGifs", label: "Autoplay gifs",
|
||||
defaultState: true),
|
||||
defaultState: true)
|
||||
],
|
||||
|
||||
"Display": @[
|
||||
|
|
Loading…
Reference in New Issue