1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-31 01:32:00 -07:00

Fix code-span in headings in 'markdown-ts-mode' (bug#80979)

* lisp/textmodes/markdown-ts-mode.el
(markdown-ts--treesit-settings): Move the 'code_span' and
'code_span_delimiter' font-lock rules into a separate block with
':override prepend' instead of 'append'.  The heading feature
(level 1) applies its face via 'font-lock-append-text-property',
so a code span that later appends 'markdown-ts-code-span' ends
up with '(markdown-ts-heading-N markdown-ts-code-span)', where
the heading face takes priority and the code-span face is
suppressed.  Prepending ensures 'markdown-ts-code-span' appears
first in the face list and wins visually.
This commit is contained in:
Rahul Martim Juliato 2026-05-07 11:24:30 -03:00 committed by João Távora
parent a00beb3a31
commit 0be998d4bc

View file

@ -1697,12 +1697,16 @@ Skip matches already inside tree-sitter link or autolink nodes."
:override 'append
'((fenced_code_block (code_fence_content) @markdown-ts--fontify-code-block))
:language 'markdown-inline
:override 'prepend
:feature 'paragraph-inline
'(((code_span) @markdown-ts-code-span)
((code_span_delimiter) @markdown-ts--fontify-delimiter))
:language 'markdown-inline
:override 'append
:feature 'paragraph-inline
'(((link_destination) @markdown-ts--fontify-link-destination)
((code_span) @markdown-ts-code-span)
((code_span_delimiter) @markdown-ts--fontify-delimiter)
((emphasis) @markdown-ts-emphasis)
((strong_emphasis) @markdown-ts-bold)
((strikethrough) @markdown-ts-strikethrough)