branch: elpa/adoc-mode
commit 26d189ef5486453503d7f0296258aa5883d27a29
Author: Tobias Zawada <t...@esi-group.com>
Commit: TobiasZawada <i...@tn-home.de>

    [#39] Also allow open blocks with source style
---
 adoc-mode.el           | 4 ++--
 test/adoc-mode-test.el | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/adoc-mode.el b/adoc-mode.el
index 4849390393..16952531e5 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -2038,9 +2038,9 @@ START-SRC and END-SRC delimit the actual source code."
   (cl-flet ((rx-or (first second) (format "\\(?:%s\\|%s\\)" first second))
             (rx-optional (stuff) (format "\\(?:%s\\)?" stuff))
             (outer-brackets-and-delimiter (&rest stuff)
-                                          ;; Listing blocks (delimiter ----) 
and literal blocks (delimiter ....) can have `source`-style:
+                                          ;; Listing blocks (delimiter ----), 
open blocks (delimiter --) and literal blocks (delimiter ....) can have 
`source`-style:
                                           ;; 
https://docs.asciidoctor.org/asciidoc/latest/blocks/delimited/#summary-of-structural-containers
-                                          (format 
"^\\[%s\\]\\s-*\n\\(?2:\\(----+\\|\\.\\{4,\\}\\)\\)\n"
+                                          (format 
"^\\[%s\\]\\s-*\n\\(?2:\\(--\\(?:--+\\)?\\|\\.\\{4,\\}\\)\\)\n"
                                                   (apply #'concat stuff)))
             ;; The language attribute is positional only (2nd slot).
             ;; It gets its default value from the document attribute 
`source-language`.
diff --git a/test/adoc-mode-test.el b/test/adoc-mode-test.el
index a9847f50f4..9fd23095a3 100644
--- a/test/adoc-mode-test.el
+++ b/test/adoc-mode-test.el
@@ -352,6 +352,13 @@ Don't use it for anything real.")
        "\n" '(adoc-meta-face adoc-native-code-face)
        "----" 'adoc-meta-face
        "\n" nil
+       ;; Code block as OPEN BLOCK
+       "\n" nil
+       "[source,adoctest-lang]\n--\n" 'adoc-meta-face
+       source-code
+       "\n" '(adoc-meta-face adoc-native-code-face)
+       "--" 'adoc-meta-face
+       "\n" nil
        ;; Code block as Literal block
        "[source,adoctest-lang]\n....\n" 'adoc-meta-face
        source-code

Reply via email to