Skip to content

fix(ghost-mcp): code-aware card/table splitting (v0.1.3) - #52

Merged
schuettc merged 1 commit into
devfrom
fix/ghost-mcp-lexical-code-aware
Jul 3, 2026
Merged

schuettc merged 1 commit into
devfrom
fix/ghost-mcp-lexical-code-aware

Conversation

@schuettc

@schuettc schuettc commented Jul 3, 2026

Copy link
Copy Markdown
Owner

The lexical builder split on <!-- card --> and <table>…</table> literally, even inside fenced or inline code — so a post that documents the card syntax got its card cut at the marker it was describing (and table/diagram examples in code blocks would break the same way).

Fix

Mask fenced blocks and inline code with NUL-delimited tokens before boundary detection, then restore verbatim. Markers/tables shown in code are left intact; real ones outside code still split as before. NUL can't occur in markdown, so tokens never collide with prose (e.g. "24 hex").

Tests (all green, 47/47)

  • <!-- card --> inside inline code → one card
  • <table> + <!-- card --> inside a fenced block → one card
  • a real <table> still becomes an html card while one shown in inline code doesn't
  • code restored verbatim, numbers nearby not mangled

Bumps package + plugin to 0.1.3 (lockstep) so @dev publishes.

https://claude.ai/code/session_01BfjjpBQzjignajX8sZXVam

The lexical builder split on <!-- card --> and <table>...</table> literally,
including inside fenced blocks and inline code. A post that documents the card
syntax (writing `<!-- card -->` in prose) had its card cut at that marker.

Mask fenced/inline code with NUL-delimited tokens before boundary detection,
then restore verbatim, so markers/tables shown in code are left intact while
real ones outside code still split. NUL can't occur in markdown, so tokens
never collide with prose (e.g. "24 hex").

Bump package + plugin to 0.1.3 (lockstep) so the dev channel publishes.

Claude-Session: https://claude.ai/code/session_01BfjjpBQzjignajX8sZXVam
@schuettc
schuettc merged commit 44f80dc into dev Jul 3, 2026
2 checks passed
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