Skip to content

Commit

Permalink
Fall back to general fontification of source blocks if lang attr is n…
Browse files Browse the repository at this point in the history
…ot given
  • Loading branch information
Tobias Zawada authored and Tobias Zawada committed Feb 12, 2024
1 parent 524e3ae commit ba334ab
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions adoc-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2109,9 +2109,10 @@ Group 2 contains the block delimiter.")
"Search for next adoc-code block up to LAST.
NOERROR is the same as for `search-forward'.
Return the source block language and
Return a string with the source block language and
set match data if a source block is found.
Otherwise return nil.
If the source block is given without the language attribute return t.
If no source block is found return nil.
The overall match data begins at the
header of the code block and ends at the end of the
Expand Down Expand Up @@ -2167,9 +2168,11 @@ Use this function as matching function MATCHER in `font-lock-keywords'."
(end-src (match-end 1))
(end-src+nl (if (eq (char-after end-src) ?\n) (1+ end-src) end-src))
(size (1+ (- end-src start-src))))
(if (if (numberp adoc-fontify-code-blocks-natively)
(<= size adoc-fontify-code-blocks-natively)
adoc-fontify-code-blocks-natively)
(if (and
(if (numberp adoc-fontify-code-blocks-natively)
(<= size adoc-fontify-code-blocks-natively)
adoc-fontify-code-blocks-natively)
(stringp lang))
(adoc-fontify-code-block-natively lang start-block end-block start-src end-src)
(add-text-properties
start-src
Expand Down

0 comments on commit ba334ab

Please sign in to comment.