diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 2119c420d..63d5bd0f0 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -23,6 +23,7 @@ capture, the end position, and the output buffer.") markdown-gfm-additional-languages '("sh") markdown-make-gfm-checkboxes-buttons t markdown-fontify-whole-heading-line t + markdown-fontify-code-blocks-natively t ;; `+markdown-compile' offers support for many transpilers (see ;; `+markdown-compile-functions'), which it tries until one succeeds. @@ -73,6 +74,13 @@ capture, the end position, and the output buffer.") :override #'markdown-match-generic-metadata (ignore (goto-char (point-max)))) + ;; HACK: markdown-mode calls a major mode without inhibiting its hooks, which + ;; could contain expensive functionality. I suppress it to speed up their + ;; fontification. + (defadvice! +markdown-optimize-src-buffer-modes-a (fn &rest args) + :around #'markdown-fontify-code-block-natively + (delay-mode-hooks (apply fn args))) + (map! :map markdown-mode-map :localleader "'" #'markdown-edit-code-block