branch: elpa/adoc-mode
commit fc590439b0c5ec36634156be40ad1e6d34732ba1
Author: sensorflo <sensor...@gmail.com>
Commit: sensorflo <sensor...@gmail.com>

    attribute list of macros can now spawn more than two lines
---
 adoc-mode-test.el | 38 ++++++++++++++++++++++++++++++++++++--
 adoc-mode.el      |  4 ++--
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/adoc-mode-test.el b/adoc-mode-test.el
index 7eb6371754..a325c8400d 100644
--- a/adoc-mode-test.el
+++ b/adoc-mode-test.el
@@ -286,7 +286,12 @@ removed before TRANSFORM is evaluated.
        "foo" markup-reference-face "[]" markup-meta-face "\n" nil
      "lorem " 'no-face "xref" markup-command-face ":" markup-meta-face
        "foo" markup-internal-reference-face "[" markup-meta-face
-       "bla bli bla blu" markup-reference-face "]" markup-meta-face
+       "bla bli bla blu" markup-reference-face "]" markup-meta-face "\n" nil
+
+     ;; caption spawns multiple lines
+     "xref" markup-command-face ":" markup-meta-face
+       "foo" markup-internal-reference-face "[" markup-meta-face
+       "bla\nbli\nbla\nblu" markup-reference-face "]" markup-meta-face "\n" nil
        ))
 
 (ert-deftest adoctest-test-footnotes ()
@@ -307,6 +312,12 @@ removed before TRANSFORM is evaluated.
      "[" markup-meta-face
      "lorem, ipsum=dolor, sit=\"amen\"" markup-secondary-text-face
      "]" markup-meta-face "\n" nil
+
+     ;; multiline attribute list
+     "footnote" markup-command-face ":" markup-meta-face
+     "[" markup-meta-face
+     "lorem\nipsum\ndolor\nsit\namen" markup-secondary-text-face
+     "]" markup-meta-face "\n" nil
      ))
 
 (ert-deftest adoctest-test-footnoterefs ()
@@ -338,6 +349,15 @@ removed before TRANSFORM is evaluated.
      "," markup-meta-face
      "lorem ipsum" markup-secondary-text-face
      "]" markup-meta-face "\n" nil
+
+     ;; multiline text
+     "lorem" 'no-face
+     "footnoteref" markup-command-face ":" markup-meta-face
+     "[" markup-meta-face
+     "myid" markup-anchor-face
+     "," markup-meta-face
+     "lorem\nipsum\ndolor\nsit" markup-secondary-text-face
+     "]" markup-meta-face "\n" nil
      ))
 
 (ert-deftest adoctest-test-images ()
@@ -360,6 +380,13 @@ removed before TRANSFORM is evaluated.
        "./foo/bar.png" markup-internal-reference-face
        "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face 
"lorem ipsum" markup-secondary-text-face "," markup-meta-face
        "title" markup-attribute-face "=" markup-meta-face "lorem ipsum" 
markup-secondary-text-face "]" markup-meta-face "\n" nil
+     ;; multiline alt and title
+     "image" markup-complex-replacement-face "::" markup-meta-face
+       "./foo/bar.png" markup-internal-reference-face
+       "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face
+       "lorem\nipsum\nsit" markup-secondary-text-face "," markup-meta-face
+       "title" markup-attribute-face "=" markup-meta-face
+       "lorem\nipsum\nsit" markup-secondary-text-face "]" markup-meta-face 
"\n" nil
 
      ;; no everything again with inline macros
      "foo " 'no-face "image" markup-complex-replacement-face ":" 
markup-meta-face 
@@ -377,7 +404,14 @@ removed before TRANSFORM is evaluated.
      "foo " 'no-face "image" markup-complex-replacement-face ":" 
markup-meta-face 
        "./foo/bar.png" markup-internal-reference-face
        "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face 
"lorem ipsum" markup-secondary-text-face "," markup-meta-face
-       "title" markup-attribute-face "=" markup-meta-face "lorem ipsum" 
markup-secondary-text-face "]" markup-meta-face "bar" 'no-face))
+       "title" markup-attribute-face "=" markup-meta-face "lorem ipsum" 
markup-secondary-text-face "]" markup-meta-face "bar" 'no-face "\n" nil
+
+     "image" markup-complex-replacement-face ":" markup-meta-face
+       "./foo/bar.png" markup-internal-reference-face
+       "[" markup-meta-face "alt" markup-attribute-face "=" markup-meta-face
+       "lorem\nipsum\nsit" markup-secondary-text-face "," markup-meta-face
+       "title" markup-attribute-face "=" markup-meta-face
+       "lorem\nipsum\nsit" markup-secondary-text-face "]" markup-meta-face 
"\n" nil))
 
 (ert-deftest adoctest-test-attribute-list ()
   (adoctest-faces "attribute-list"
diff --git a/adoc-mode.el b/adoc-mode.el
index 863cc2d883..e5d5827071 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -994,7 +994,7 @@ Subgroups:
    "^\\(" (or cmd-name "[a-zA-Z0-9_]+") "\\)::"
    "\\([^ \t\n]*?\\)"
    "\\["
-   "\\(.*?\\)"
+   "\\(" (adoc-re-content) "\\)"
    "\\][ \t]*$"))
 
 ;; ?P<id>[\w\-_]+
@@ -1213,7 +1213,7 @@ Subgroups of returned regexp:
    (cond
     ((eq attribute-list-constraints 'empty) "")
     ((eq attribute-list-constraints 'single-attribute) 
"[^\n,]*?\\(?:\n[^\n,]*?\\)??")
-    (t ".*?\\(?:\n.*?\\)??"))
+    (t (adoc-re-content)))
    "\\)\\(\\]\\)" ))
 
 ;; todo: use same regexps as for font lock

Reply via email to