Skip to content

fix: markdown headings, dash lists and table separators - #76

Open
lvolland wants to merge 1 commit into
speed-highlight:mainfrom
lvolland:fix/markdown-headings-lists
Open

fix: markdown headings, dash lists and table separators#76
lvolland wants to merge 1 commit into
speed-highlight:mainfrom
lvolland:fix/markdown-headings-lists

Conversation

@lvolland

@lvolland lvolland commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

hey! found this highlighting a readme with md.

the cmnt rule (=|-)\1+ isn't anchored, so it fires on any -- or == in a line. your own readme hits it: every |------| in the language table is painted as a setext underline. -/+ bullets, 1) lists and atx headings had no rule.

| name | class |
| ---- | ----- |
# heading
- dash bullet
+ plus
1) paren
foo -- bar

today only the ---- cells and the -- are colored, as cmnt. expected: table row plain, # as section, the three bullets as kwd.

fix: anchor cmnt to a whole line (^[ \t]*(=|-)\1+[ \t]*$), widen the list rule to [*+-] / \d+[.)], add a section rule. the list rule ends with ([ \t]|$) so a marker alone on its line stays lit while you type — same spirit as the optional closing delimiters elsewhere. +81 bytes, ~+69 minified (estimated). test.md updated; it's the only fixture that moves.

notes

  • any --/== not alone on its line loses its cmnt: i--, a == b, --verbose, tables with or without outer pipes.
  • token edges move: spaces around a setext underline now sit inside the span. same rendering, different snapshot.
  • # heading and a bare # stay uncolored, to keep 4-space code blocks dark.
  • section isn't styled in github-dim.css or termcolor.js — pre-existing, but md makes it visible.
  • happy to move section lower if you prefer the ini/toml ordering 🙂

@lvolland
lvolland force-pushed the fix/markdown-headings-lists branch from d4c7138 to a637d8d Compare August 1, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant