Skip to content

Markdown: Don't let Liquid objects interrupt paragraphs - #20085

Closed
lazerg wants to merge 2 commits into
prettier:mainfrom
lazerg:fix/issue-20083-liquid-object-interrupt
Closed

lazerg wants to merge 2 commits into
prettier:mainfrom
lazerg:fix/issue-20083-liquid-object-interrupt

Conversation

@lazerg

@lazerg lazerg commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Description

Since #19838 the Liquid flow construct is allowed to interrupt a paragraph, so a line that merely starts with {{ ... }} is torn out of the paragraph it belongs to:

**ASCII** is a {{glossary("character encoding")}} standard using 7-bit to represent 128
{{glossary("character", "characters")}} used by computers.

becomes two paragraphs with a blank line between them. This is what changed across MDN in v3.9.7.

{{ ... }} is an output expression, it is inline by nature, so it shouldn't end a paragraph any more than `code` does. {% ... %} is a tag and does start a block, which is what #19985 needs, so only that one keeps interrupting. Output for the case above is now byte-identical to 3.9.6 again.

Fixes #20083

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.
  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

@netlify

netlify Bot commented Sep 16, 2026

Copy link
Copy Markdown

✅ Deploy Preview for prettier ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit aa22991
🔍 Latest deploy log https://app.netlify.com/projects/prettier/deploys/6aaa9427b1dff600076e4cd5
😎 Deploy Preview https://deploy-preview-20085--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Sep 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

yarn add https://pkg.pr.new/@prettier/plugin-hermes@20085.tgz
yarn add https://pkg.pr.new/@prettier/plugin-oxc@20085.tgz
yarn add https://pkg.pr.new/@prettier/plugin-yuku@20085.tgz
yarn add https://pkg.pr.new/prettier@20085.tgz

commit: 47a54c2

@netlify

netlify Bot commented Sep 16, 2026

Copy link
Copy Markdown

✅ Deploy Preview for prettier ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 47a54c2
🔍 Latest deploy log https://app.netlify.com/projects/prettier/deploys/6aaa9448fbc14b000829eb1c
😎 Deploy Preview https://deploy-preview-20085--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@fisker

fisker commented Sep 16, 2026

Copy link
Copy Markdown
Member

@lazerg Thanks for fixing this, would you mind fixing this in v3.9.x branch instead of main?

@lazerg

lazerg commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor Author

I opened #20086 against v3.9.x with the same fix instead. Closing this one.

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.

Regression in v3.9.7

2 participants