branch: elpa/adoc-mode commit 576d7243302a134a0234557fb38fbff5ab659541 Author: sensorflo <sensor...@gmail.com> Commit: sensorflo <sensor...@gmail.com>
'caption' of http/... inline macros can now contain commas Also, the previous code behaved as if these inline macros have one positional attribute or a named attribute 'caption'. But AsciiDoc only looks at the whole attribute list ({0}). --- adoc-mode-test.el | 6 ++++++ adoc-mode.el | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/adoc-mode-test.el b/adoc-mode-test.el index a325c8400d..c88622efdd 100644 --- a/adoc-mode-test.el +++ b/adoc-mode-test.el @@ -616,6 +616,12 @@ removed before TRANSFORM is evaluated. "http://www.lorem.com/ipsum.html" markup-internal-reference-face "[" markup-meta-face "sit amet" markup-reference-face "]" markup-meta-face " bar \n" nil + ;; link text contains newlines and commas + "http://www.lorem.com/ipsum.html" markup-internal-reference-face + "[" markup-meta-face + "sit,\namet,\nconsectetur" markup-reference-face + "]" markup-meta-face + " bar \n" nil ;; url inline macro withOUT attriblist "http://www.lorem.com/ipsum.html" markup-reference-face "[]" markup-meta-face diff --git a/adoc-mode.el b/adoc-mode.el index 56392c7de6..66b9e29c2d 100644 --- a/adoc-mode.el +++ b/adoc-mode.el @@ -1575,15 +1575,14 @@ meta characters." ;; largely copied from adoc-kw-inline-macro ;; todo: output text should be affected by quotes & co, e.g. bold, emph, ... (defun adoc-kw-inline-macro-urls-attribute-list () - (let ((cmd-name (regexp-opt '("http" "https" "ftp" "file" "irc" "mailto" "callto" "link"))) - (attribute-list '(("caption") (("caption" . markup-reference-face))))) + (let ((cmd-name (regexp-opt '("http" "https" "ftp" "file" "irc" "mailto" "callto" "link")))) (list `(lambda (end) (adoc-kwf-std end ,(adoc-re-inline-macro cmd-name) '(0) '(0))) `(1 '(face markup-internal-reference-face adoc-reserved t) t) ; cmd-name `(2 '(face markup-internal-reference-face adoc-reserved t) t) ; : `(3 '(face markup-internal-reference-face adoc-reserved t) t) ; target '(4 '(face markup-meta-face adoc-reserved t) t) ; [ - `(5 '(face markup-reference-face adoc-attribute-list ,attribute-list) append) + `(5 '(face markup-reference-face adoc-attribute-list markup-reference-face) append) '(6 '(face markup-meta-face adoc-reserved t) t)))) ; ] (defun adoc-kw-inline-macro-urls-no-attribute-list ()