relative to absolute links in mastoapi content
This commit is contained in:
parent
900054bab0
commit
91d3f4138c
@ -4,6 +4,7 @@ import ".."/[types, formatters, utils]
|
||||
|
||||
proc formatTweetForMastoAPI*(tweet: Tweet, cfg: Config, prefs: Prefs): string =
|
||||
var content = replaceUrls(tweet.text, prefs)
|
||||
content = content.replace("href=\"/", &"href=\"{getUrlPrefix(cfg)}/")
|
||||
|
||||
if tweet.poll.isSome():
|
||||
let poll = get(tweet.poll)
|
||||
@ -24,7 +25,7 @@ proc formatTweetForMastoAPI*(tweet: Tweet, cfg: Config, prefs: Prefs): string =
|
||||
if tweet.quote.isSome():
|
||||
let
|
||||
quote = get(tweet.quote)
|
||||
quoteContent = replaceUrls(quote.text, prefs)
|
||||
quoteContent = replaceUrls(quote.text, prefs).replace("href=\"/", &"href=\"{getUrlPrefix(cfg)}/")
|
||||
quoteUrl = &"{getUrlPrefix(cfg)}/i/status/{quote.id}"
|
||||
content &= &"\n\n<blockquote><b>↘ <a href=\"{quoteUrl}\">{quote.user.fullName} (@{quote.user.username})</a></b>\n{quoteContent}"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user