diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index bfb7868565..44e9741ef0 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -338,8 +338,11 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{ ls = c.currentList() if ls is not None: lf = ls.format() - lf.setStyle(fmt) - ls.setFormat(lf) + if lf.style() == fmt: + c.setBlockFormat(QTextBlockFormat()) + else: + lf.setStyle(fmt) + ls.setFormat(lf) else: ls = c.createList(fmt) @@ -1053,6 +1056,6 @@ if __name__ == '__main__': w.show() w.html = '''
Test blockquote
He hadn't
set out to have an affair,
- much less a long-term, devoted one.'''
+ much less a long-term, devoted one.
hello''' app.exec_() # print w.html