diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 1dfa2c02d6..1d5e914d5f 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -116,6 +116,9 @@ class EditorWidget(QWebView): # {{{ ss = extra_shortcuts.get(wac, None) if ss: ac.setShortcut(QKeySequence(getattr(QKeySequence, ss))) + if wac == 'RemoveFormat': + ac.triggered.connect(self.remove_format_cleanup, + type=Qt.QueuedConnection) self.action_color = QAction(QIcon(I('format-text-color')), _('Foreground color'), self) @@ -227,6 +230,9 @@ class EditorWidget(QWebView): # {{{ js = 'document.execCommand("%s", false, null);' % cmd frame.evaluateJavaScript(js) + def remove_format_cleanup(self): + self.html = self.html + @dynamic_property def html(self):