diff --git a/manual/edit.rst b/manual/edit.rst index 11c52972b9..a15be4b97d 100644 --- a/manual/edit.rst +++ b/manual/edit.rst @@ -814,7 +814,8 @@ The HTML editor has very sophisticated syntax highlighting. Features include: * As you move your cursor through the HTML, the matching HTML tags are highlighted, and you can jump to the opening or closing tag with the keyboard shortcuts :kbd:`Ctrl+{` and :kbd:`Ctrl+}`. Similarly, you - can select the contents of a tag with :kbd:`Ctrl+Alt+T`. + can select the contents of a tag with :kbd:`Ctrl+Alt+T` or + :kbd:`Ctrl+Shift+T`. * Invalid HTML is highlighted with a red underline * Spelling errors in the text inside HTML tags and attributes such as title are highlighted. The spell checking is language aware, based on the value diff --git a/src/calibre/gui2/tweak_book/editor/smarts/html.py b/src/calibre/gui2/tweak_book/editor/smarts/html.py index 402b2f2ca4..6d03a04355 100644 --- a/src/calibre/gui2/tweak_book/editor/smarts/html.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/html.py @@ -671,6 +671,9 @@ class Smarts(NullSmarts): is_xml = editor.syntax == 'xml' mods = ev.modifiers() & ( Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.AltModifier | Qt.KeyboardModifier.MetaModifier | Qt.KeyboardModifier.KeypadModifier) + shifted_mods = ev.modifiers() & ( + Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.AltModifier | Qt.KeyboardModifier.MetaModifier | + Qt.KeyboardModifier.KeypadModifier | Qt.KeyboardModifier.ShiftModifier) if tprefs['replace_entities_as_typed'] and ( ';' in ev_text or @@ -728,7 +731,8 @@ class Smarts(NullSmarts): if mods == Qt.KeyboardModifier.ControlModifier: if self.jump_to_enclosing_tag(editor, key == Qt.Key.Key_BraceLeft): return True - if key == Qt.Key.Key_T and mods == (Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.AltModifier): + if key == Qt.Key.Key_T and shifted_mods in ( + Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.AltModifier, Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.ShiftModifier): return self.select_tag_contents(editor) return False