This commit is contained in:
Aevann1 2021-09-02 22:33:48 +02:00
parent f74bb1808e
commit 3864bba3a6
14 changed files with 39 additions and 43 deletions

View file

@ -92,9 +92,9 @@ class CustomRenderer(HTMLRenderer):
def render_sub_mention(self, token):
space = token.target[0]
target = token.target[1]
return f'{space}<a href="https://old.reddit.com/r/{target}" class="d-inline-block">r/{target}</a>'
return f'{space}<a href="https://old.reddit.com/r/{target}" rel="nofollow noopener noreferrer" class="d-inline-block">r/{target}</a>'
def render_redditor_mention(self, token):
space = token.target[0]
target = token.target[1]
return f'{space}<a href="https://old.reddit.com/u/{target}" class="d-inline-block">u/{target}</a>'
return f'{space}<a href="https://old.reddit.com/u/{target}" rel="nofollow noopener noreferrer" class="d-inline-block">u/{target}</a>'