Skip to content

Sync from livetemplate@v0.23.0 - #131

Closed
adnaan wants to merge 1 commit into
mainfrom
sync/livetemplate
Closed

Sync from livetemplate@v0.23.0#131
adnaan wants to merge 1 commit into
mainfrom
sync/livetemplate

Conversation

@adnaan

@adnaan adnaan commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Automated sync from https://github.com/livetemplate/livetemplate at ref v0.23.0.

See content/_meta/source-of-truth.yaml for the page mapping that drives this sync. Bring concerns about a specific change to the source repo, not this PR — edits made directly here will be overwritten on the next sync.

@adnaan

adnaan commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #132.

This branch carries the correct v0.23.0 content, but through a rewriter with a bug I introduced in #130: RewriteRelative skipped fenced code blocks and not inline ones, so Go generic syntax inside a code span — `AssertPureState[T](t)` — was resolved as a relative path and rewritten into a URL. This diff reproduces that corruption in reference/session.md, reference/limitations.md and guides/ephemeral-components.md.

#132 fixes the rewriter, adds regression tests for the inline-span, multi-span and unbalanced-backtick cases, and re-syncs at v0.23.0 — which repairs the five corrupted pages and brings down the same release content this PR carries. It is a strict superset, so merging this first would only publish the corruption again.

The rolling sync/livetemplate branch is untouched and the next release dispatch will reopen it normally.

@adnaan adnaan closed this Aug 2, 2026
adnaan added a commit that referenced this pull request Aug 2, 2026
… broke (#132)

Fixes a bug introduced in #130 that corrupted five published pages.

RewriteRelative skipped fenced code blocks but not inline code spans, and Go
generic call syntax inside one — `AssertPureState[T](t)` — contains the exact
](...) shape a markdown link does. The rewriter resolved (t) as a relative path,
so documented code rendered on the live site as a GitHub URL, in
reference/session.md (three places), reference/limitations.md and
guides/ephemeral-components.md. The #130 plan flagged this exact risk; the guard
written for it covered only the fenced case, which is not the one that occurs
in this corpus.

rewriteOutsideCodeSpans splits a line on backticks and rewrites only the
even-indexed prose segments. A line with an odd number of backticks cannot have
its spans paired — the parity is wrong from the stray one onward, so code would
land on an "outside" index and be rewritten anyway — and is left entirely alone.
That costs a genuine link on a malformed line staying as upstream wrote it,
which is recoverable; mangling documented code is not.

Three regression tests, all failing against the previous implementation: an
inline span alongside a real link, multiple spans interleaved with links, and
the unbalanced-backtick case. The last one caught a wrong claim in the first
version of the safety comment, which is why the explicit count check exists
rather than relying on parity.

Re-syncs at v0.23.0, which repairs the five pages and carries the release's own
content — the Async/Pending guide rewrite, the Validate reference and the lvt-el
overlay section from livetemplate#530. Supersedes #131, closed unmerged because
it carried the same content through the unfixed rewriter.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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