Fix html entities in tag clicking
offlate/tagclickedit.py
5 | 5 | import re | |
6 | 6 | import sys | |
7 | 7 | from urllib.parse import quote | |
8 | + | import html | |
8 | 9 | ||
9 | 10 | class TagClickEdit(QTextBrowser): | |
10 | 11 | def __init__(self, *args): | |
… | |||
14 | 15 | text = self.toHtml() | |
15 | 16 | for word_object in re.finditer(r'@[a-z]+{[^}]*}', text): | |
16 | 17 | 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>') | |
18 | 19 | self.setHtml(text) | |
19 | 20 | ||
20 | 21 | if __name__ == '__main__': |