Skip to content

Commit 227723e

Browse files
committed
Don't see all pre tags as suggestions
1 parent 971255d commit 227723e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bot/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ def __iter__(self):
9696
in_quote = False
9797
in_tag = 0
9898
for token in super().__iter__():
99-
if token['type'] == 'StartTag' and token['name'] == 'pre':
100-
if not in_tag:
101-
token['data'] = {}
102-
yield {
103-
'data': 'Suggestion:\n',
104-
'type': 'Characters'
105-
}
99+
if (not in_tag and token['type'] == 'StartTag' and token['name'] == 'pre'
100+
and token['data'] and 'suggestion' in token['data'][(None, 'lang')]):
101+
token['data'] = {}
102+
yield {
103+
'data': 'Suggestion:\n',
104+
'type': 'Characters'
105+
}
106106

107107
if token['type'] == 'StartTag' and token['name'] == 'li':
108108
if not (token['data'] and token['data'].get('class') != 'task-list-item'):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy