Skip to content

fix: inline backtick rendering in tables, headings, blockquotes and mermaid sizing#53

Merged
nicholasjpaterno merged 5 commits into
Epistates:mainfrom
esumerfd:main
May 10, 2026
Merged

fix: inline backtick rendering in tables, headings, blockquotes and mermaid sizing#53
nicholasjpaterno merged 5 commits into
Epistates:mainfrom
esumerfd:main

Conversation

@esumerfd

@esumerfd esumerfd commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Table cells: Call format_inline_markdown() on cells containing backtick markers, producing styled inline code spans instead of plain text
  • Regression test: Add test verifying inline code in headings does not leak into the next paragraph
  • Test file: Add tests/docs/test_backticks.md for visual verification of all backtick variants (paragraphs, headings, lists, blockquotes, tables)
  • Mermaid: Expand mermaid image size to fit terminal width and fix scrolling problems

Note: The rendering fixes in this PR depend on a companion fix to turbovault-parser (PR against Epistates/turbovault) that correctly routes Event::Code for headings, blockquotes, and table cells during parsing.

Build Failing:

This build is dependent on the turbovault_parser changes. We could have ignored this test but think perging PRs in the right sequence might be the simpler approach.

      257      #[test]
      258 +    #[ignore = "requires turbovault-parser fix (Epistates/turbovault#15) to be merged and published"]
      259      fn test_heading_inline_code_not_leaked_to_paragraph() {

Test plan

  • Run just run tests/docs/test_backticks.md and verify inline code renders correctly in all contexts
  • Verify mermaid diagrams expand to terminal width
  • Run cargo test — all 180 tests pass

🤖 Generated with Claude Code

esumerfd and others added 3 commits April 18, 2026 16:21
Backtick fixes (requires turbovault-parser fix):
- Render inline code in table cells and headers via format_inline_markdown()
- Add regression test for inline code in headings and blockquotes
- Add tests/docs/test_backticks.md for visual verification

Mermaid improvements:
- Expand mermaid image size to fit terminal width
- Fix mermaid image scrolling problems

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…published

Test depends on Epistates/turbovault#15 being merged and released to crates.io.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reverts ignore — Nick should merge Epistates/turbovault#15 first,
then this PR will pass CI cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nicholasjpaterno added a commit that referenced this pull request Apr 28, 2026
Bump version, refresh dependencies, and document the toggle-details
fix plus the recently-merged CLI fixes (--filter/--level in --tree,
--at-line, -s with formatted headings) and the new integration test
suites.

Notes the in-flight #51 / #53 inline-backtick rendering issue under
Known Issues since the fix depends on a companion turbovault-parser
release.
@nicholasjpaterno

Copy link
Copy Markdown
Contributor

Thanks for this PR! The companion turbovault-parser fix landed in 1.4.1, and main (now at 0.5.11) has it via cargo update. Rebasing this PR onto main makes the previously-ignored test pass — verified locally, all 245 tests green.

Two follow-ups needed before merging:

1. Mermaid feature gates need the unix constraint

In 0.5.11 (commit 77dcd73), I aligned every #[cfg(feature = "mermaid")] site with the cfg(unix) gating that Cargo.toml already applies to mermaid-rs-renderer and resvg. Without this, the cross-platform release CI breaks on x86_64-pc-windows-msvc (it's why the v0.5.10 release run failed and never produced a GH Release).

After rebasing, please update the new mermaid gates this PR adds so they match. Concretely:

#[cfg(feature = "mermaid")]              →  #[cfg(all(feature = "mermaid", unix))]
#[cfg(not(feature = "mermaid"))]         →  #[cfg(not(all(feature = "mermaid", unix)))]

Affected sites after rebase (all in src/tui/):

  • interactive.rs:43, 212 (and any others the PR adds)
  • mod.rs:120
  • app.rs:508, 511, 514, 720, 722, 724, 923, 940, 942 (the index_interactive_elements helper especially — its not(feature = "mermaid") fallback needs to fire on Windows too)
  • ui/mod.rs:28, 413, 415 (and the mermaid_source_hash call site around 1617)

You can verify with:

cargo build --no-default-features --features unstable-dynamic   # Windows-equivalent path
cargo build                                                      # Unix default path

Both should succeed. Currently the no-default-features build fails with 3 errors (HashMap out of scope, mermaid_source_hash not found).

2. Three new clippy warnings

src/tui/interactive.rs:89   manual_clamp        → (x * 5).clamp(25, 120)
src/tui/ui/mod.rs:750       manual_div_ceil     → disp_w_px.div_ceil(font_size.0)
                            needless_borrow     → (location TBD; clippy will pinpoint)

Once those land, this is good to merge. Happy to help if you'd like me to push a fixup commit to your branch instead.

@esumerfd

esumerfd commented Apr 30, 2026 via email

Copy link
Copy Markdown
Contributor Author

@nicholasjpaterno nicholasjpaterno merged commit f7a4ec9 into Epistates:main May 10, 2026
1 check passed
@nicholasjpaterno

Copy link
Copy Markdown
Contributor

Looks great, thanks@esumerfd! Apologies for the delay on this one!

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.

2 participants