Re-introduce undocumented fontification of example blocks

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Do not assert
that `org-src-fontify-natively' only applies to code blocks.  Allow
other blocks with language specifier to be fontified, but keep this
behavior undocumented.

Reported-by: Rudi C <rudiwillalwaysloveyou@gmail.com>
Link: https://orgmode.org/list/CAE9z9A3ko27NeN0oYFs_aBWV_cUbNm5YQTLrRux16dHsixsMBA@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2024-02-25 13:00:12 +03:00
parent 37e468cf16
commit 9daad41ccf
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 10 additions and 1 deletions

View File

@ -5526,7 +5526,16 @@ by a #."
(org-remove-flyspell-overlays-in nl-before-endline end-of-endline)
(cond
((and org-src-fontify-natively
(string= block-type "src"))
;; Technically, according to
;; `org-src-fontify-natively' docstring, we should
;; only fontify src blocks. However, it is common
;; to use undocumented fontification of example
;; blocks with undocumented language specifier.
;; Keep this undocumented feature for user
;; convenience.
t
;; (string= block-type "src")
)
(save-match-data
(org-src-font-lock-fontify-block (or lang "") block-start block-end))
(add-text-properties bol-after-beginline block-end '(src-block t)))