* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
New corresponding test.
;; the resulting number of calls to syntax-ppss made it too slow
;; (bug#33887), so we're now careful to leave alone any pair
;; of quotes that doesn't hold a < or > char, which is the vast majority.
- ("\\(?:\\(1:\"\\)[^\"<>]*[<>\"]\\|\\(1:'\\)[^'<>]*[<>']\\)"
+ ("\\(?:\\(?1:\"\\)[^\"<>]*[<>\"]\\|\\(?1:'\\)[^'<>]*[<>']\\)"
(1 (unless (memq (char-before) '(?\' ?\"))
;; Be careful to call `syntax-ppss' on a position before the one
;; we're going to change, so as not to need to flush the data we
(sgml-quote (point-min) (point-max) t)
(should (string= "&&" (buffer-string))))))
+(ert-deftest sgml-tests--quotes-syntax ()
+ (with-temp-buffer
+ (sgml-mode)
+ (insert "a\"b <tag>c'd</tag>")
+ (should (= 1 (car (syntax-ppss (1- (point-max))))))
+ (should (= 0 (car (syntax-ppss (point-max)))))))
+
(provide 'sgml-mode-tests)
;;; sgml-mode-tests.el ends here