Skip to content

fix: ten pre-release review findings for 0.9.0 - #21

Merged
borghei merged 10 commits into
mainfrom
fix/review-0-9-0
Oct 1, 2026
Merged

borghei merged 10 commits into
mainfrom
fix/review-0-9-0

Conversation

@borghei

@borghei borghei commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the ten findings from the high-effort code review of v0.8.0..main, one commit and one regression test each.

  1. Anchor links now match headings containing inline code, dashes, shortcodes and links.
  2. The terminal background query is only sent when its answer is used, waits long enough for slow links, and a late reply is dropped instead of leaking into the shell or acting as key presses.
  3. The progress bar moves when colour is off.
  4. The image side limit no longer rejects tall screenshots and large photos; the allocation cap alone bounds decompression bombs.
  5. The WSL clipboard fallback finds clip.exe and PowerShell by absolute path when the Windows PATH is not appended.
  6. In ASCII mode, a leading # is treated as decoration only for headings, not in code lines.
  7. Links to files with # in the name work again; [[page#section]] and [[#section]] wikilinks jump to the heading. A link that cannot be followed shows a message.
  8. The deep-nesting guard measures real nesting depth, so long code lines and wide tables no longer switch footnotes off.
  9. Link history shares the document source instead of copying it, is capped at 256 entries, and re-reads a local file that changed on disk.
  10. A trailing or doubled <br> in a table cell no longer adds blank lines.

Testing

fmt, clippy and the full suite pass locally (357 tests), including the pty suite. Snapshots unchanged. The Windows build of these changes is verified by this PR's CI only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UVcvmQrSXd2eyt32g4ko19

borghei added 10 commits October 1, 2026 14:43
Anchors were slugged from the TOC display text, which drops inline code
and carries smart-punctuation dashes, so [x](#install-ink-cli) or a
heading made only of code could not be reached. Layout now records each
heading's anchor text (inline code, :shortcode:, -- as written) next to
the display text, and #fragment links match against that.
The background query gave up after 100 ms (400 ms over SSH), so on slow
links not flagged as SSH the reply arrived later and was echoed at the
prompt or read as keys. The wait is now 1 s for every terminal (the DA1
answer still ends it at once on a normal terminal), a partial reply at
the deadline gets one 500 ms extension, and the reader drops an OSC 11
reply already queued as input when the query got nothing at all. The
query is also no longer sent when its answer is unused: --list-themes,
non-rendering subcommands, and colour turned off.
With --color=never or NO_COLOR the filled and remaining parts of the bar
were the same glyph in the same default colour, so it always read 100%.
When the two colours cannot be told apart and the glyphs are the same,
the remainder is now drawn blank.
The 8192 px per-side limit refused real images that rendered in v0.8.0.
The side limit is now 65535 (it only rejects nonsense headers); the
256 MB allocation cap, checked against the declared output size before
any pixel exists, is what bounds a decompression bomb. A grey
11000x11000 bomb now decodes once and is cached at 2048 px a side; the
same image as RGBA (~484 MB) is still refused.
…ws PATH

The PowerShell fallback was looked up on PATH, but it exists for
appendWindowsPath=false, where neither clip.exe nor powershell.exe is on
PATH. On WSL ink now also probes the C: drive mount (/mnt/c, or /c with
automount root=/) for clip.exe, then for powershell.exe.
In ASCII mode every leading # was skipped as decoration, so in a code
box a line like '| # install deps' or '| #include' put the visual-mode
cursor past the #, and a yank from line start dropped it. A # run now
counts only as the line's first mark and when a space follows it.
Links were split at the first # before resolving, so [notes](c#-notes.md)
or [x](issue#12.md), followed in v0.8.0, silently did nothing. The whole
link is now tried as a file name first (%23 decoded), then split at the
last #, then the first. [[page#Section]] resolves to page.md with the
heading text as fragment (matched by slug, as in Obsidian), and
[[#Section]] jumps within the document. A link that cannot be followed
now flashes a message instead of doing nothing.
The deep-nesting guard counted every * _ ~ [ on a line, inside fenced
code and tables too, so one long minified line or a wide table row of
links turned every [^1] into literal text. Footnotes are now disabled
only when the measured AST depth (from a probe parse without footnotes,
which comrak runs iteratively) exceeds 1200; comrak's recursive footnote
pass overflows a 1 MB debug stack at about 1940. The probe runs only
when the document uses [^ and has enough nesting-capable characters to
reach the limit.
Every NavEntry held its own copy of the tab source, pushed for each
in-page anchor jump and cloned again on every back/forward; history was
unbounded, so a 5 MB document and 200 jumps held about 1 GB. The source
is now an Arc<str> shared by the tab and its entries, history keeps the
last 256 places, and going back to a local file that changed on disk
since re-reads it, as v0.8.0 did (stdin and URL documents still use the
snapshot).
…breaks

A cell ending in <br> was drawn one line taller with an empty last line,
and <br><br> left a blank line inside the cell. Breaks in a cell now only
separate content: leading, trailing and repeated ones are dropped, as a
trailing break in a paragraph already is.
@borghei
borghei merged commit 0c4982b into main Oct 1, 2026
8 checks passed
@borghei
borghei deleted the fix/review-0-9-0 branch October 1, 2026 13:22
@borghei borghei mentioned this pull request Oct 1, 2026
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