branch: elpa/adoc-mode
commit e6b8e6984360b69ba3e05012f04723fe91fe81db
Author: Philip Lord <[email protected]>
Commit: sensorflo <[email protected]>
bugfix: empty AsciiDoc attributes (e.g. [,]) caused adoc-mode to enter
infinite loop
---
adoc-mode-test.el | 14 ++++++++++++++
adoc-mode.el | 2 ++
2 files changed, 16 insertions(+)
diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index 3889e553da..68ca1efaa4 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -299,6 +299,20 @@ removed before TRANSFORM is evaluated.
;; multiple positional attributes
"[" markup-meta-face "hello" markup-value-face "," markup-meta-face
"world" markup-value-face "]" markup-meta-face "\n" nil
+ ;; multiple positional attributes, however one or both are empty (really
empty or only one space)
+ "[" markup-meta-face "hello" markup-value-face ",]" markup-meta-face "\n"
nil
+ "[" markup-meta-face "hello" markup-value-face "," markup-meta-face " "
markup-value-face "]" markup-meta-face "\n" nil
+ "[," markup-meta-face "hello" markup-value-face "]" markup-meta-face "\n"
nil
+ "[" markup-meta-face " " markup-value-face "," markup-meta-face "hello"
markup-value-face "]" markup-meta-face "\n" nil
+ "[,]" markup-meta-face "\n" nil
+ "[," markup-meta-face " " markup-value-face "]" markup-meta-face "\n" nil
+ "[" markup-meta-face " " markup-value-face ",]" markup-meta-face "\n" nil
+ "[" markup-meta-face " " markup-value-face "," markup-meta-face " "
markup-value-face "]" markup-meta-face "\n" nil
+
+ ;; zero positional attributes
+ "[]" markup-meta-face "\n" nil
+ "[" markup-meta-face " " markup-value-face "]" markup-meta-face "\n" nil
+
;; keyword attribute
"[" markup-meta-face "salute" markup-attribute-face "=" markup-meta-face
"hello" markup-value-face "]" markup-meta-face "\n" nil
;; keyword attribute where value is a string
diff --git a/adoc-mode.el b/adoc-mode.el
index 474ef6e74f..2de6492396 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -1293,6 +1293,8 @@ text having adoc-reserved set to 'block-del."
(face (adoc-attribute-elt-face pos-or-id (get-text-property
(match-beginning 0) 'adoc-attribute-list))))
(put-text-property (match-beginning group) (match-end group) 'face
face))
(when (numberp pos-or-id) (setq pos-or-id (1+ pos-or-id)))))))
+
+ (goto-char end2))))
nil)
(defun adoc-facespec-subscript ()