Display full annotation text in details panel

This commit is contained in:
Kovid Goyal 2020-07-13 09:29:59 +05:30
parent 70f1540484
commit 572341e632
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -391,14 +391,15 @@ class DetailsPanel(QWidget):
annot_text = ''
a = prepare_string_for_xml
for part in r['text'].split('\n\x1f\n'):
segments = []
for bit in part.split('\x1d'):
segments.append(a(bit) + ('</b>' if len(segments) % 2 else '<b>'))
stext = ''.join(segments)
if stext.endswith('<b>'):
stext = stext[:-3]
annot_text += '<div style="text-align:left">' + stext + '</div><div>&nbsp;</div>'
paras = []
if annot['type'] == 'bookmark':
paras.append(annot['title'])
elif annot['type'] == 'highlight':
paras.append(annot['highlighted_text'])
paras.append(annot.get('notes') or '')
for para in paras:
annot_text += '<div style="text-align:left">' + para + '</div><div>&nbsp;</div>'
date = parse_iso8601(annot['timestamp']).strftime('%Y-%m-%d %H:%M:%S')
text = '''