From 6155d07b1db9afe023b93c2479661b7b4960fd70 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 25 Apr 2025 11:40:43 +0530 Subject: [PATCH] Leave out whitespace and control chars from summary field --- src/calibre/gui2/tweak_book/reports.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/reports.py b/src/calibre/gui2/tweak_book/reports.py index f312700550..b1122b73d8 100644 --- a/src/calibre/gui2/tweak_book/reports.py +++ b/src/calibre/gui2/tweak_book/reports.py @@ -7,6 +7,7 @@ __copyright__ = '2015, Kovid Goyal ' import os import textwrap import time +import unicodedata from collections import defaultdict from contextlib import suppress from csv import writer as csv_writer @@ -906,7 +907,8 @@ class CharsWidget(QWidget): def __call__(self, data): self.model(data) self.chars.resize_rows() - self.summary.setText(''.join(self.model.all_chars)) + c = unicodedata.category + self.summary.setText(''.join(sorted(ch for ch in self.model.all_chars if c(ch) not in ('Zs', 'Cc')))) self.filter_edit.clear() def double_clicked(self, index):