diff --git a/src/calibre/gui2/viewer/highlights.py b/src/calibre/gui2/viewer/highlights.py index b19e995ecd..8e5acf7d41 100644 --- a/src/calibre/gui2/viewer/highlights.py +++ b/src/calibre/gui2/viewer/highlights.py @@ -116,6 +116,9 @@ class Highlights(QListWidget): highlights = (h for h in highlights if not h.get('removed') and h.get('highlighted_text')) for h in self.sorted_highlights(highlights): txt = h.get('highlighted_text') + txt = txt.replace('\n', ' ') + if len(txt) > 100: + txt = txt[:100] + '…' i = QListWidgetItem(txt, self) i.setData(Qt.UserRole, h) self.uuid_map[h['uuid']] = self.count() - 1