You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Six targeted fixes from the v0.19 PR review. Each is small and scoped;
the riskier items from the review (plan-diff block variants, HTML
relative non-doc links) are tracked as follow-ups.
Smart punctuation — CLI flags preserved:
- Narrowed the `--` → en-dash rule to only fire between digits
(`pages 3--5` still converts; `bun --watch` stays literal).
GitHub alerts — list/code/heading bodies absorb correctly:
- Blockquote merge now always merges into a previous alert blockquote,
regardless of whether the new line starts with a block marker. Without
this, `> [!NOTE]\n> - item` split the list off into a plain italic
quote and emptied the alert.
- AlertBlock got a mini block-level renderer for the body so `- item` /
`* item` / `1. item` render as real <ul>/<ol>, not flattened prose.
Forge-aware mentions/issue refs:
- packages/shared/repo: new parseRemoteHost() extracts the host from
the git remote URL; RepoInfo gains an optional `host` field.
- packages/server/repo: getRepoInfo populates host alongside display.
- Viewer only passes githubRepo to InlineMarkdown when the host is
exactly "github.com". Non-GitHub repos render mentions/issue refs
as styled text, no wrong github.com links.
HTML block external links:
- rewriteRelativeRefs now forces `target="_blank"` and
`rel="noopener noreferrer"` on every external http(s) link inside
raw HTML. Fixes two problems in one pass: external links no longer
hijack the review tab, and pasted-HTML links can't tab-nab the
plannotator tab via window.opener.
Heading anchor dedup:
- New buildHeadingSlugMap() walks all heading blocks and assigns
`foo`, `foo-1`, `foo-2`, ... for repeats (GitHub convention).
BlockRenderer receives the anchor id as a prop from Viewer via a
memoized map rather than computing per-block; first occurrence
keeps the bare slug so existing links stay stable.
URL autolink bracket balance:
- Trailing `)`/`]`/`}` in bare URLs are kept when they balance an
earlier opener inside the URL. Wikipedia-style
`https://en.wikipedia.org/wiki/Function_(mathematics)` now keeps its
paren; `(see https://x.com)` still trims the orphan.
Tests: +8 (157 total).
- utils/slugify.test: buildHeadingSlugMap dedup behavior, non-heading
skipping, empty-slug skipping.
- utils/inlineTransforms.test: CLI flags stay literal, `3--5` still
converts.
- utils/parser.test: alerts with list body / code fence body, blank
line ending an alert.
Fixture:
- tests/test-fixtures/13-known-issues.md — reproduces each of the
review findings end-to-end; useful as a regression check going
forward.
Deferred (tracked for follow-up):
- Plan diff view doesn't render html / directive / alertKind semantics
(SimpleBlockRenderer has no cases for the new block variants).
- Relative non-doc links inside raw HTML (.pdf, .csv) don't get
rewritten — only .md/.mdx/.html are routed through the linked-doc
overlay today. Not a regression; narrow audience.
For provenance purposes, this commit was AI assisted.
<BlockRendererimageBaseDir={imageBaseDir}onImageClick={(src,alt)=>setLightbox({ src, alt })}key={group.block.id}block={group.block}onOpenLinkedDoc={onOpenLinkedDoc}onToggleCheckbox={onToggleCheckbox}checkboxOverrides={checkboxOverrides}githubRepo={repoInfo?.display}/>
634
+
<BlockRendererimageBaseDir={imageBaseDir}onImageClick={(src,alt)=>setLightbox({ src, alt })}key={group.block.id}block={group.block}onOpenLinkedDoc={onOpenLinkedDoc}onToggleCheckbox={onToggleCheckbox}checkboxOverrides={checkboxOverrides}githubRepo={repoInfo?.host==='github.com' ? repoInfo?.display : undefined}headingAnchorId={headingSlugMap.get(group.block.id)}/>
0 commit comments