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
Prettier 3.9.1 (also 3.9.0; both current latest). This is a regression — every 3.8.x release leaves the input untouched (verified on 3.8.3 and the latest 3.8.x, 3.8.5).
Formatting Markdown that contains a multi-line Hugo shortcode whose closing %}} delimiter sits on its own line silently rewrites that line to a bare }, corrupting the document. No error or warning is emitted.
Input (prettier --parser markdown input.md):
{{% blocks/cover
title="Welcome"
%}}
Body text here.
{{% /blocks/cover %}}
Output (3.9.0 and 3.9.1):
{{% blocks/cover
title="Welcome"
}
Body text here.
{{% /blocks/cover %}}
Expected (unchanged — what every 3.8.x release produces):
{{% blocks/cover
title="Welcome"
%}}
Body text here.
{{% /blocks/cover %}}
Notes
The standalone %}} line becomes } — the %} is dropped and the document's meaning changes. A single-line {{% … %}} is fine; only the multi-line opener (closing delimiter on its own line) triggers it. Default options reproduce it (see Playground link).
This isn't a request to format Hugo shortcodes — only to leave them untouched, exactly as every 3.8.x release did. Silently rewriting syntax it doesn't fully parse is data corruption, and because multi-line shortcodes are common in Hugo content, 3.9.x is effectively unusable on many Hugo sites until this is fixed. (Re: the non-standard-syntax disclaimer — non-destructive pass-through is what's expected here, not bespoke shortcode support.)
Related but distinct:Markdown file fail to parse #19386 was a parse crash (RangeError) in the same {{ … }} area, fixed before 3.9.0 shipped; this is a different symptom — a silent rewrite, no crash.
Prettier 3.9.1 (also 3.9.0; both current
latest). This is a regression — every 3.8.x release leaves the input untouched (verified on 3.8.3 and the latest 3.8.x, 3.8.5).Playground link
Formatting Markdown that contains a multi-line Hugo shortcode whose closing
%}}delimiter sits on its own line silently rewrites that line to a bare}, corrupting the document. No error or warning is emitted.Input (
prettier --parser markdown input.md):{{% blocks/cover title="Welcome" %}} Body text here. {{% /blocks/cover %}}Output (3.9.0 and 3.9.1):
{{% blocks/cover title="Welcome" } Body text here. {{% /blocks/cover %}}Expected (unchanged — what every 3.8.x release produces):
{{% blocks/cover title="Welcome" %}} Body text here. {{% /blocks/cover %}}Notes
%}}line becomes}— the%}is dropped and the document's meaning changes. A single-line{{% … %}}is fine; only the multi-line opener (closing delimiter on its own line) triggers it. Default options reproduce it (see Playground link).remark-parsev8 →micromarkv4 (Upgrade to latest micromark (markdown only) #18277).RangeError) in the same{{ … }}area, fixed before 3.9.0 shipped; this is a different symptom — a silent rewrite, no crash.Environment
--parser markdown, default options