diff --git a/adoc-mode.el b/adoc-mode.el index 4849390..1695253 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 a9847f5..9fd2309 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