-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Subtask of #348. Align next/v3 Raw and Conditional behavior with main by adopting the rehype plugin based Raw and Conditional pipeline (including <![endif]/--> closers, head aware conditionals, multiline Raw support, and Raw inside Conditional) and backfilling the associated tests and snapshots.
Target branch
All work for this issue should be implemented against the next/v3 branch.
- Branch from
origin/next/v3. - Open pull requests with
baseset tonext/v3(notmain).
Context
On main, Raw and Conditional are implemented as a plugin-driven pipeline:
<Raw>uses a rehype plugin to turn placeholder nodes intotype: 'raw'nodes so multiline HTML is emitted verbatim.<Conditional>renders light-weight markers that a rehype plugin then transforms into conditional comment blocks, includinghead-aware conditionals and the safer<![endif]/-->closer.- Tests assert correct closer syntax, support for nested
<Raw>inside<Conditional>, and correct<head>/<body>placement.
On next/v3, Raw and Conditional still rely on string-based rendering (including a Suspense-based Conditional implementation) and older closer behavior. This issue is about bringing next/v3 up to the same behavioral baseline as main while keeping the v3 branch focus.
Implementation notes
When working this issue:
- Use the Raw/Conditional comparison work in charlie: head vs next/v3 #348 as a guide for the expected behavior on
main. - Port the rehype-based Raw and Conditional plugins, plus the updated
<Conditional>implementation, frommainintonext/v3, reconciling any v3-only differences in the renderer. - Bring over the dedicated tests and snapshots for Raw and Conditional (including closer, multiline Raw, and Raw-inside-Conditional cases) so
next/v3has the same coverage asmain. - Keep the public API surface of
<Raw>and<Conditional>unchanged; the goal is to align behavior and serialization, not to introduce new props or flags.