Skip to content

fix(formatter_markdown): honor range ignore inside directives - #28164

Merged
graphite-app[bot] merged 1 commit into
mainfrom
10-26-fix_formatter_markdown_honor_range_ignore_inside_directives
Oct 26, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
10-26-fix_formatter_markdown_honor_range_ignore_inside_directives

Conversation

@leaysgur

Copy link
Copy Markdown
Member

Fixes #28154

Range ignore is supported only at the top level.

Prettier does not support directives, so the contents of ::: end up at the top level and the range works there.
We parse ::: as a container directive, so its contents were not top-level and the range was ignored.

This PR treats a ::: directive with no blockquote / list item / footnote above it as top-level.

Supporting ranges everywhere is possible, but it has concerns such as indentation drift in verbatim output. So this starts small.

leaysgur commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added the A-formatter Area - Formatter (oxfmt). Add F-* labels for details label Oct 26, 2026
@leaysgur leaysgur added the run-oxfmt-ecosystem-ci Add to a PR to dispatch Oxfmt Ecosystem CI (oxc-project/oxc-ecosystem-ci) against its branch label Oct 26, 2026
@oxc-guard

oxc-guard Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Oxfmt Ecosystem CI

suite oxfmt@latest main refs/pull/28164/head branch
tale/headplane ✅ ✅ ✅
fuma-nama/fumadocs ✅ ✅ ✅
eggjs/egg ❌ ✅ ✅
monkeytypegame/monkeytype ✅ ✅ ✅
actualbudget/actual ✅ ✅ ✅
lichess-org/lila ✅ ✅ ✅
Comfy-Org/ComfyUI_frontend ❌ 🟨 ✅
huggingface/huggingface.js ❌ ✅ ✅
AmanVarshney01/create-better-t-stack ✅ ✅ ✅
cnpm/cnpmcore ❌ ✅ ✅
openclaw/openclaw ✅ 🟨 ✅
formatjs/formatjs ✅ ✅ ✅
vuejs/pinia ❌ ✅ ✅
dyad-sh/dyad ❌ 🟨 ✅
vercel/turborepo ❌ ✅ ✅
rolldown/rolldown ❌ ✅ ✅
sveltejs/kit ✅ ✅ ✅
cloudflare/agents ❌ ✅ ✅
npmx-dev/npmx.dev ✅ ✅ ✅
vuejs/core ✅ ✅ ✅
fastify/fastify-vite ❌ ✅ ✅
cloudflare/workers-sdk ❌ 🟨 ✅
cloudflare/kumo ❌ ✅ ✅
aidenybai/react-grab ❌ ✅ ✅
mantinedev/mantine ✅ ✅ ✅
mastodon/mastodon ✅ ✅ ✅
getsentry/sentry-javascript ✅ ✅ ✅

💥 = panic, ⚠️ = error e.g. parse error (main/branch columns: only new errors), ❌ = diff or exit code mismatch, 🟨 = differs from oxfmt@latest (merged-but-unreleased changes)

@oxc-guard oxc-guard Bot removed the run-oxfmt-ecosystem-ci Add to a PR to dispatch Oxfmt Ecosystem CI (oxc-project/oxc-ecosystem-ci) against its branch label Oct 26, 2026
@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Oct 26, 2026

leaysgur commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

Merge activity

Fixes #28154

Range ignore is supported only at the top level.

Prettier does not support directives, so the contents of `:::` end up at the top level and the range works there.
We parse `:::` as a container directive, so its contents were not top-level and the range was ignored.

This PR treats a `:::` directive with no blockquote / list item / footnote above it as top-level.

Supporting ranges everywhere is possible, but it has concerns such as indentation drift in verbatim output. So this starts small.
@graphite-app
graphite-app Bot force-pushed the 10-26-chore_oxfmt_bump_prettier-plugin-astro_to_1.1.2 branch from 8a14354 to 3e7f0f5 Compare October 26, 2026 03:54
@graphite-app
graphite-app Bot force-pushed the 10-26-fix_formatter_markdown_honor_range_ignore_inside_directives branch from 2f7bb07 to 23d23d6 Compare October 26, 2026 03:55
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Oct 26, 2026
Base automatically changed from 10-26-chore_oxfmt_bump_prettier-plugin-astro_to_1.1.2 to main October 26, 2026 03:58
@graphite-app
graphite-app Bot merged commit 23d23d6 into main Oct 26, 2026
35 checks passed
@graphite-app
graphite-app Bot deleted the 10-26-fix_formatter_markdown_honor_range_ignore_inside_directives branch October 26, 2026 03:59
Dunqing added a commit that referenced this pull request Oct 27, 2026
# Oxlint
### 🚀 Features

- cf34678 oxlint: Export `Oxlintrc` type (#28132) (Sysix)
- 831cdf1 oxlint: Require mininum oxlint-tsgolint version v7.0.2005
(#28118) (camc314)
- d1b00f4 linter/typescript: Implement no-unsafe-enum-assignment rule
(#28117) (camc314)
- 165c91f linter/typescript/await-thenable: Support
`allowMixedPromiseArrays` option (#28116) (camc314)

### 🐛 Bug Fixes

- 7f3c908 linter/eslint/array-callback-return: Check callbacks passed
with extra arguments (#28133) (sarankumar)
- 53be530 linter: Filter by type aware rules when looking up tsgolint
rule severity (#28138) (NavpreetSSidhu)
- e0f8937 react-compiler: Compile a `try` whose `catch` is unreachable
instead of panicking (#28066) (Dunqing)
- f5b625f linter/eslint/no-useless-concat: See through parenthesized
expressions (#27984) (Rahul Kashyap)
- 4629bb2 linter/jest/no-conditional-expect: Check function expression
callbacks (#28055) (camc314)
- 5c84098 semantic,linter: Report names with lone surrogates in enum and
lint checks (#27991) (Dunqing)
- f3705a9 linter/eslint/prefer-const: Skip fixers if any declarator is
reassigned (#28008) (Prince Jain)
- 4c0fa90 minifier,linter: Keep `delete` of constant members and later
JSX keys (#27990) (Dunqing)
- 0298062 linter/arrow-body-style: Keep type assertions when adding a
block body (#27978) (Yan Almeida)
# Oxfmt
### 🐛 Bug Fixes

- 5042019 formatter: Keep fill layout for array with comment after [
(#28170) (leaysgur)
- 9d37ff6 formatter: Use position-based comment checks for concise
arrays (#28169) (leaysgur)
- 016c4a2 formatter: Keep a comment before `}` inside a JSX spread child
(#28103) (vidigoat)
- 190bb1e formatter: Keep parens around an instantiation expression
ending an operand through any tight parent (#28168) (leaysgur)
- a5314a1 formatter: Keep `;` before `in` and `instanceof` class members
(#28166) (leaysgur)
- 3a56e7c formatter: Keep closing HTML comments at the start of a line
(#28064) (Cameron)
- 23d23d6 formatter_markdown: Honor range ignore inside directives
(#28164) (leaysgur)
- 5f1fd3d formatter: Measure width heuristics by display width (#28098)
(leaysgur)
- a5a52cf formatter: Keep parens around private `in` expressions
(#28096) (leaysgur)
- 999496e formatter: Measure a short key by its display width (#28026)
(vidigoat)
- 7e9aa44 formatter: Keep parens around a looser operand of an
instantiation expression (#28025) (vidigoat)
- 6912d1f formatter: Keep an arrow signature that exactly fills the line
for any body (#27989) (leaysgur)
- eb1d9f9 formatter_core: Count a flat `line` space in `fits` only when
text follows (#27987) (leaysgur)

### ⚡ Performance

- 1ed93af data_structures: Copy short strings without a memcpy call
(#27953) (leaysgur)
- 7948f0b formatter_core: Shrink `FormatElement` to 16B (#28012)
(leaysgur)
- 788af22 formatter: Keep `AstNode`s on the stack, and only chain links
in the arena (#27963) (leaysgur)

### 📚 Documentation

- 068a8ea formatter: Fix up wording (#28167) (leaysgur)
- db55461 formatter_core: Document text width divergence (#28095)
(leaysgur)
- 880d229 formatter: Add vitest-test-call to known divergences (#28006)
(leaysgur)

Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter (oxfmt). Add F-* labels for details

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oxfmt: prettier-ignore-start/end is ignored inside ::: containers in markdown

1 participant