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
This commit is contained in:
Binbin Ye 2026-07-03 16:23:48 +08:00 committed by Juri Linkov
parent 43ff22a0d1
commit 7d01f8f7a4

View file

@ -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