fix(highlight): complete markdown syntax highlighting with injections

Fix markdown code block highlighting to properly support both markdown
structure (headings, frontmatter) and language injection (rust, bash).

The key fix uses `#set! injection.include-children` in the injection
query to override tree-sitter-md's internal tokenization, enabling
proper highlighting of embedded languages within code fences.

Changes:
- Use crate's HIGHLIGHT_QUERY_BLOCK for base markdown highlighting
- Add custom injection query with include-children directive
- Add YAML/TOML frontmatter and HTML block injection rules
- Add text.* highlight names (title, literal, uri, reference)
- Add string.escape highlight name
- Add CSS styles for new highlight classes
- Remove unused custom md-highlights.scm
This commit is contained in:
Timothy DeHerrera
2026-01-31 17:24:27 -07:00
parent 352b3c1941
commit 905897b3c4
4 changed files with 52 additions and 37 deletions

23
docs/static/style.css vendored
View File

@@ -208,6 +208,29 @@ pre code {
color: #ff79c6;
}
/* Markdown-specific text highlighting */
.hl-text-title {
color: #ff79c6;
font-weight: bold;
}
.hl-text-literal {
color: #8be9fd;
}
.hl-text-uri {
color: #8be9fd;
text-decoration: underline;
}
.hl-text-reference {
color: #bd93f9;
}
.hl-string-escape {
color: #ffb86c;
}
/* Section navigation */
.section-nav {
display: flex;