Skip to content

docs: render code blocks and multi-paragraph content inside notes (#312) - #313

Merged
hachej merged 1 commit into
mainfrom
fix/issue-312-note-code-block
Oct 28, 2026
Merged

hachej merged 1 commit into
mainfrom
fix/issue-312-note-code-block

Conversation

@hachej

@hachej hachej commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Fixes #312.

Problem

On querying/methods#aggregate, the CRITICAL note showed only the first two lines of its code example as inline text, followed by a large empty box. The same bug cut off three other notes, without the empty box:

Page Note What was lost
querying/methods CRITICAL aggregate() the ❌ WRONG example; the stray fence also swallowed the next section
building/semantic-tables Give every source a unique name the code example and the closing paragraph
building/semantic-tables Join predicates resolve physical columns the example code
agents/mcp uv / python config the JSON config

Cause

  1. Note.tsx kept only plain-string children. Markdown ends a raw <note> HTML block at the first blank line, so everything after it arrives as already-rendered elements, which were dropped.
  2. In query-methods.md, that blank line sat inside the code fence. The raw HTML block ended mid-fence, # ❌ WRONG … became a heading, and the closing ``` opened a new fence that swallowed </note> and the following section.

Fix

  • Note.tsx: strings still go through the note's own markdown; element children are now rendered as they are. Paragraphs inside a note get note-sized text.
  • query-methods.md: blank line before the fence.
  • semantic-table.md: blank line before </note>, so a trailing paragraph doesn't absorb the closing tag. Fixing the component exposed this: the note grew to 2878px and wrapped the rest of the page.
  • bsl-data/*.json: only the markdown line is updated. Running the full docs build also changes query outputs (row order, SQL aliases), so I left those out.

Verification

  • Ran the local Vite dev server and measured every note with Playwright. All are 57–361px tall; the semantic-tables note is 307px, down from 2878px.
  • Screenshots of the four notes show the full code blocks, the trailing paragraph in note styling, and the next heading outside the note.
  • eslint passes on Note.tsx, and tsc reports no errors in it.

🤖 Generated with Claude Code

The Note component only kept plain-string children, so anything after
the first blank line inside a <note> (code blocks, extra paragraphs) was
dropped. On query-methods the blank line sat inside a code fence, which
ended the raw HTML block mid-fence: the rest of the example leaked out
as a heading and the stray fence swallowed the following section.

- Note renders already-parsed element children alongside its markdown
  strings, with note-sized paragraph styles.
- query-methods: blank line before the fence so it parses as markdown.
- semantic-table: blank line before </note> so a trailing paragraph
  doesn't absorb the closing tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hachej
hachej merged commit 8b92c88 into main Oct 28, 2026
9 checks passed
@boringdata
boringdata deleted the fix/issue-312-note-code-block branch October 28, 2026 19:47
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.

Document render bug on query method page

2 participants