mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 15:23:52 -05:00
Fix broken whitespace in redraft
This still doesn't, for example, reconstruct the markdown the author may have used to format their post.
This commit is contained in:
parent
eb18df9d64
commit
d80e049bb0
@ -766,7 +766,7 @@ def redraft(request, id):
|
|||||||
toot_content = re.sub("(^\n)|(\n$)", "", re.sub("\n\n", "\n", toot_content))
|
toot_content = re.sub("(^\n)|(\n$)", "", re.sub("\n\n", "\n", toot_content))
|
||||||
# Fix up references
|
# Fix up references
|
||||||
for mention in toot.mentions:
|
for mention in toot.mentions:
|
||||||
menchie_re = re.compile(r"\s?@" + mention.username + r"\s", re.I)
|
menchie_re = re.compile(r"\s?@\s" + mention.acct + r"\s", re.I)
|
||||||
toot_content = menchie_re.sub(
|
toot_content = menchie_re.sub(
|
||||||
" @" + mention.acct + " ", toot_content, count=1
|
" @" + mention.acct + " ", toot_content, count=1
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user