From 572341e632c847ac370885cf82195c7506a4fd26 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Jul 2020 09:29:59 +0530 Subject: [PATCH] Display full annotation text in details panel --- src/calibre/gui2/library/annotations.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/calibre/gui2/library/annotations.py b/src/calibre/gui2/library/annotations.py index 283415bd8f..18efe602a0 100644 --- a/src/calibre/gui2/library/annotations.py +++ b/src/calibre/gui2/library/annotations.py @@ -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) + ('' if len(segments) % 2 else '')) - stext = ''.join(segments) - if stext.endswith(''): - stext = stext[:-3] - annot_text += '
' + stext + '
 
' + 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 += '
' + para + '
 
' date = parse_iso8601(annot['timestamp']).strftime('%Y-%m-%d %H:%M:%S') text = '''