diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-14 23:40:28 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-14 23:40:28 -0500 |
| commit | b5e72eacf791c7ea06648ca4199f263aa380ae5a (patch) | |
| tree | 7888c4fad03d8bfb7a6609d44b87b3be465de1c4 /modules | |
| parent | fe8c4c7c00b7bdd5bc23b479f5605f2806c879a8 (diff) | |
| download | dotemacs-b5e72eacf791c7ea06648ca4199f263aa380ae5a.tar.gz dotemacs-b5e72eacf791c7ea06648ca4199f263aa380ae5a.zip | |
feat(markdown-config): register markdown as an org src-block language
`#+begin_src markdown ... #+end_src' blocks rendered and exported
fine but `org-lint' warned on every one of them ("Unknown source
block language: 'markdown'"), and `C-c '' inside the block fell
back to `fundamental-mode' instead of opening it in
`markdown-mode' for editing.
Add a `with-eval-after-load 'org' form that pushes
`("markdown" . markdown)' onto `org-src-lang-modes'. New ERT test
in `tests/test-markdown-config.el' asserts the entry resolves to
`markdown' after `(require 'markdown-config)'.
Surfaced while clearing `org-lint' on `todo.org' from 55 issues
down to 1 -- the last one was this warning on a Linear ticket-body
draft that was genuinely markdown. Registering the language is
the right fix; relabeling the block as `text' or `example' would
lose accuracy.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/markdown-config.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/markdown-config.el b/modules/markdown-config.el index 438aea7e..2536904a 100644 --- a/modules/markdown-config.el +++ b/modules/markdown-config.el @@ -15,6 +15,13 @@ ("<f2>" . markdown-preview)) ;; use same key as compile for consistency :init (setq markdown-command "multimarkdown")) +;; Register markdown as a known org-src-block language so `org-lint' +;; stops warning on `#+begin_src markdown ... #+end_src' and `C-c '' +;; inside such a block opens it in `markdown-mode' instead of falling +;; back to fundamental-mode. +(with-eval-after-load 'org + (add-to-list 'org-src-lang-modes '("markdown" . markdown))) + ;;;; ------------------------- Impatient-Mode ------------------------ ;; allows for live previews of your html |
