emacs-31 7d01f8f7a4e: Fix syntax of tsx tag angle brackets to use matching pairs
Juri Linkov <[email protected]> Fri, 3 Jul 2026 11:12:54 -0400 (EDT)
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: emacs-31 commit 7d01f8f7a4e1b2a5608d2c866309ef4074ecf404 Author: Binbin Ye <[email protected]> Commit: Juri Linkov <[email protected]> Fix syntax of tsx tag angle brackets to use matching pairs The matching characters for JSX tag angle brackets were self-referential ('<' matched '<', and '>' matched '>') rather than pointing at each other. Tools that check the matching character, such as 'show-paren-mode' and the rainbow-delimiters package, therefore treated every JSX closing '>' as a mismatched delimiter. Use the same descriptors as 'sgml-make-syntax-table', where '<' is closed by '>' and '>' by '<' (bug#81348). * lisp/progmodes/typescript-ts-mode.el (tsx-ts--syntax-propertize-captures): Give '<' the syntax descriptor "(>" and '>' the descriptor ")<". Copyright-paperwork-exempt: yes --- lisp/progmodes/typescript-ts-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 61e281310aa..cf13363e48a 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -860,8 +860,8 @@ at least 3 (which is the default value)." (match-beginning 0) (match-end 0) 'syntax-table (string-to-syntax (cond - ((equal (match-string 0) "<") "(<") - ((equal (match-string 0) ">") ")>") + ((equal (match-string 0) "<") "(>") + ((equal (match-string 0) ">") ")<") (t "."))))))))))) ;;;###autoload