diff options
| author | Noam Postavsky | 2019-05-18 14:37:51 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-06-04 08:42:50 -0400 |
| commit | d414c93b062cc3e245a6db0cb764d354d037bd42 (patch) | |
| tree | e594558391e8a55800012b8d9642e322685ff355 /test/lisp | |
| parent | e04f93e18a8083d3a4930decc523c4f5d9a97c9e (diff) | |
| download | emacs-d414c93b062cc3e245a6db0cb764d354d037bd42.tar.gz emacs-d414c93b062cc3e245a6db0cb764d354d037bd42.zip | |
Don't sgml-syntax-propertize-inside XML prolog (Bug#32823)
* lisp/nxml/nxml-mode.el (nxml-syntax-propertize): New function.
(nxml-mode): Use it as the syntax-propertize-function.
* test/lisp/nxml/nxml-mode-tests.el (nxml-mode-doctype-and-quote-syntax)
(nxml-mode-prolog-comment): New tests.
Diffstat (limited to 'test/lisp')
| -rw-r--r-- | test/lisp/nxml/nxml-mode-tests.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lisp/nxml/nxml-mode-tests.el b/test/lisp/nxml/nxml-mode-tests.el index 92744be619d..70816bb9de0 100644 --- a/test/lisp/nxml/nxml-mode-tests.el +++ b/test/lisp/nxml/nxml-mode-tests.el | |||
| @@ -78,5 +78,26 @@ | |||
| 78 | (should-not (equal (get-text-property squote-txt-pos 'face) | 78 | (should-not (equal (get-text-property squote-txt-pos 'face) |
| 79 | (get-text-property dquote-att-pos 'face)))))) | 79 | (get-text-property dquote-att-pos 'face)))))) |
| 80 | 80 | ||
| 81 | (ert-deftest nxml-mode-doctype-and-quote-syntax () | ||
| 82 | (with-temp-buffer | ||
| 83 | (insert "<!DOCTYPE t [\n<!ENTITY f SYSTEM \"f.xml\">\n]>\n<t>'</t>") | ||
| 84 | (nxml-mode) | ||
| 85 | ;; Check that last tag is parsed as a tag. | ||
| 86 | (should (= 1 (car (syntax-ppss (1- (point-max)))))) | ||
| 87 | (should (= 0 (car (syntax-ppss (point-max))))))) | ||
| 88 | |||
| 89 | (ert-deftest nxml-mode-prolog-comment () | ||
| 90 | (with-temp-buffer | ||
| 91 | (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- comment1 --> | ||
| 92 | <t><!-- comment2 --></t><!-- comment3 -->") | ||
| 93 | (nxml-mode) | ||
| 94 | ;; Check that all comments are parsed as comments | ||
| 95 | (goto-char (point-min)) | ||
| 96 | (search-forward "comment1") | ||
| 97 | (should (nth 4 (syntax-ppss))) | ||
| 98 | (search-forward "comment2") | ||
| 99 | (should (nth 4 (syntax-ppss))) | ||
| 100 | (search-forward "comment3"))) | ||
| 101 | |||
| 81 | (provide 'nxml-mode-tests) | 102 | (provide 'nxml-mode-tests) |
| 82 | ;;; nxml-mode-tests.el ends here | 103 | ;;; nxml-mode-tests.el ends here |