Fix html entities in tag clicking

Julien LepillerTue Oct 09 22:48:21+0200 2018

63088a9

Fix html entities in tag clicking

offlate/tagclickedit.py

55
import re
66
import sys
77
from urllib.parse import quote
8+
import html
89
910
class TagClickEdit(QTextBrowser):
1011
    def __init__(self, *args):

1415
        text = self.toHtml()
1516
        for word_object in re.finditer(r'@[a-z]+{[^}]*}', text):
1617
            rep = word_object.string[word_object.span()[0] : word_object.span()[1]]
17-
            text = text.replace(rep, '<a href="#' + quote(rep) + '">' + rep + '</a>')
18+
            text = text.replace(rep, '<a href="#' + quote(html.unescape(rep)) + '">' + rep + '</a>')
1819
        self.setHtml(text)
1920
2021
if __name__ == '__main__':