diff options
| author | Noam Postavsky | 2019-05-26 11:07:14 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-06-04 08:42:50 -0400 |
| commit | 438e4804d107720f526d0c7c367cbd029f264676 (patch) | |
| tree | 3b8a3561bc86f6a67a65d918c1f064e21445cbd0 /lisp | |
| parent | 7aaf500701be3b51c686b7d86c9b505ef5fa9b8f (diff) | |
| download | emacs-438e4804d107720f526d0c7c367cbd029f264676.tar.gz emacs-438e4804d107720f526d0c7c367cbd029f264676.zip | |
Fix some SGML syntax edge cases (Bug#33887)
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Handle
single and double quotes symmetrically. Don't skip quoted comment
enders.
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
Add more test cases.
(sgml-mode-quote-in-long-text): New test.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 75f20722b05..1df7e78afc5 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -363,9 +363,12 @@ Any terminating `>' or `/' is not matched.") | |||
| 363 | ;; the resulting number of calls to syntax-ppss made it too slow | 363 | ;; the resulting number of calls to syntax-ppss made it too slow |
| 364 | ;; (bug#33887), so we're now careful to leave alone any pair | 364 | ;; (bug#33887), so we're now careful to leave alone any pair |
| 365 | ;; of quotes that doesn't hold a < or > char, which is the vast majority. | 365 | ;; of quotes that doesn't hold a < or > char, which is the vast majority. |
| 366 | ("\\(?:\\(?1:\"\\)[^\"<>]*\\|\\(?1:'\\)[^'\"<>]*\\)" | 366 | ("\\([\"']\\)[^\"'<>]*" |
| 367 | (1 (if (eq (char-after) (char-after (match-beginning 0))) | 367 | (1 (if (eq (char-after) (char-after (match-beginning 0))) |
| 368 | (forward-char 1) | 368 | (forward-char 1) |
| 369 | ;; Avoid skipping comment ender. | ||
| 370 | (when (eq (char-after) ?>) | ||
| 371 | (skip-chars-backward "-")) | ||
| 369 | ;; Be careful to call `syntax-ppss' on a position before the one | 372 | ;; Be careful to call `syntax-ppss' on a position before the one |
| 370 | ;; we're going to change, so as not to need to flush the data we | 373 | ;; we're going to change, so as not to need to flush the data we |
| 371 | ;; just computed. | 374 | ;; just computed. |