Function: cider-docview-fontify-code-blocks
cider-docview-fontify-code-blocks is a byte-compiled function defined
in cider-doc.el.
Signature
(cider-docview-fontify-code-blocks BUFFER MODE)
Documentation
Font lock BUFFER code blocks using MODE and remove markdown characters.
This processes the triple backtick GFM markdown extension. An overlay is used to shade the background. Blocks are marked to be ignored by other fonification and line wrap.
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-doc.el
;;; Font Lock and Formatting
(defun cider-docview-fontify-code-blocks (buffer mode)
"Font lock BUFFER code blocks using MODE and remove markdown characters.
This processes the triple backtick GFM markdown extension. An overlay is used
to shade the background. Blocks are marked to be ignored by other fonification
and line wrap."
(with-current-buffer buffer
(save-excursion
(while (search-forward-regexp "```\n" nil t)
(replace-match "")
(let ((beg (point))
(bg `(:background ,cider-docview-code-background-color)))
(when (search-forward-regexp "```\n" nil t)
(replace-match "")
(cider-font-lock-region-as mode beg (point))
(overlay-put (make-overlay beg (point)) 'font-lock-face bg)
(put-text-property beg (point) 'block 'code)))))))