diff --git a/CHANGELOG.md b/CHANGELOG.md index a2e8de9633..a3534132aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed `TextArea.code_editor` missing recently added attributes https://github.com/Textualize/textual/pull/4172 - Fixed `Sparkline` not working with data in a `deque` https://github.com/Textualize/textual/issues/3899 - Tooltips are now cleared when the related widget is no longer under them https://github.com/Textualize/textual/issues/3045 +- Simplified tree-sitter highlight queries for HTML, which also seems to fix segfault issue https://github.com/Textualize/textual/pull/4195 ## [0.52.1] - 2024-02-20 diff --git a/src/textual/tree-sitter/highlights/html.scm b/src/textual/tree-sitter/highlights/html.scm index 15f2adb436..41c83ce0d8 100644 --- a/src/textual/tree-sitter/highlights/html.scm +++ b/src/textual/tree-sitter/highlights/html.scm @@ -6,45 +6,6 @@ (quoted_attribute_value) @string) (text) @text @spell -((element (start_tag (tag_name) @_tag) (text) @text.title) - (#eq? @_tag "title")) - -((element (start_tag (tag_name) @_tag) (text) @text.title.1) - (#eq? @_tag "h1")) - -((element (start_tag (tag_name) @_tag) (text) @text.title.2) - (#eq? @_tag "h2")) - -((element (start_tag (tag_name) @_tag) (text) @text.title.3) - (#eq? @_tag "h3")) - -((element (start_tag (tag_name) @_tag) (text) @text.title.4) - (#eq? @_tag "h4")) - -((element (start_tag (tag_name) @_tag) (text) @text.title.5) - (#eq? @_tag "h5")) - -((element (start_tag (tag_name) @_tag) (text) @text.title.6) - (#eq? @_tag "h6")) - -((element (start_tag (tag_name) @_tag) (text) @text.strong) - (#any-of? @_tag "strong" "b")) - -((element (start_tag (tag_name) @_tag) (text) @text.emphasis) - (#any-of? @_tag "em" "i")) - -((element (start_tag (tag_name) @_tag) (text) @text.strike) - (#any-of? @_tag "s" "del")) - -((element (start_tag (tag_name) @_tag) (text) @text.underline) - (#eq? @_tag "u")) - -((element (start_tag (tag_name) @_tag) (text) @text.literal) - (#any-of? @_tag "code" "kbd")) - -((element (start_tag (tag_name) @_tag) (text) @text.uri) - (#eq? @_tag "a")) - ((attribute (attribute_name) @_attr (quoted_attribute_value (attribute_value) @text.uri)) diff --git a/src/textual/widgets/_text_area.py b/src/textual/widgets/_text_area.py index c9df6143fd..e6bce9aa29 100644 --- a/src/textual/widgets/_text_area.py +++ b/src/textual/widgets/_text_area.py @@ -678,7 +678,7 @@ def _watch_show_line_numbers(self) -> None: self.scroll_cursor_visible() def _watch_indent_width(self) -> None: - """Changing width of tabs will change document display width.""" + """Changing width of tabs will change the document display width.""" self._rewrap_and_refresh_virtual_size() self.scroll_cursor_visible()