Skip to content

feat(message-compiler): support escape sequence#2394

Merged
kazupon merged 2 commits into
masterfrom
feat/at-mark-support
Feb 17, 2026
Merged

feat(message-compiler): support escape sequence#2394
kazupon merged 2 commits into
masterfrom
feat/at-mark-support

Conversation

@kazupon

@kazupon kazupon commented Feb 17, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Add backslash escape sequences for special characters ({, }, @, |, ) in messages as an alternative to literal interpolation (available from v12 onward)
  • Documentation

    • Updated English, Japanese, and Chinese guides with an escape-sequence reference table, examples for templates and locale messages, and a note that backslash + non-special character preserves the backslash

@kazupon kazupon added the Type: Feature Includes new features label Feb 17, 2026
@coderabbitai

coderabbitai Bot commented Feb 17, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR adds backslash-based escape sequence support for special characters ({, }, @, |, \) across the message compiler (tokenizer, parser, grammar) and updates documentation (EN/JP/ZH) and tests; escape sequences are supported from v12 onward.

Changes

Cohort / File(s) Summary
Syntax docs (EN/JP/ZH)
docs/guide/essentials/syntax.md, docs/jp/guide/essentials/syntax.md, docs/zh/guide/essentials/syntax.md
Adds "Escape Sequences" subsection with backslash escape table, examples in locale messages and templates, and note that backslash before non-special chars is literal; updates prior literal-interpolation guidance.
Other docs link fixes (JP/ZH)
docs/jp/guide/advanced/..., docs/jp/guide/essentials/..., docs/zh/guide/advanced/..., docs/zh/guide/essentials/...
Adjusts multiple relative API reference links (deeper paths) in Japanese and Chinese docs.
Tokenizer implementation
packages/message-compiler/src/tokenizer.ts
Adds backslash handling to consume backslash + special char (or backslash) as escaped sequence inside text and placeholder contexts; treats backslash before non-special char as normal char.
Parser implementation
packages/message-compiler/src/parser.ts
Introduces TEXT_ESCAPES pattern and fromTextEscapeSequence to map escape sequences to literal characters during text parsing.
Tokenizer tests
packages/message-compiler/test/tokenizer/text.test.ts
Replaces todos with comprehensive tests covering escape scenarios, Unicode, edge-cases, and token location assertions.
Parser tests
packages/message-compiler/test/parser/text.test.ts
Adds "escape sequences" test suite validating parsed AST for escaped characters, double-backslash paths, non-special backslash behavior, and escapes within placeholders.
Grammar spec
spec/syntax.ebnf
Bumps syntax version v0.6.0 → v0.7.0; changes TextChar to include TextEscape and adds TextEscape ::= #x005C (SpecialChar

Sequence Diagram

sequenceDiagram
    participant Input as Message Input
    participant Tokenizer
    participant Parser
    participant TextProc as Text Processing

    Input->>Tokenizer: Raw message with escapes (e.g., "foo\@bar")
    Note over Tokenizer: Detect backslash + special char
    Tokenizer->>Tokenizer: Consume escape as single token
    Tokenizer->>Parser: Emit token stream
    Parser->>TextProc: Process TEXT tokens
    Note over TextProc: Apply fromTextEscapeSequence mapping (\@ → @)
    TextProc-->>Input: Rendered text output (e.g., "foo@bar")
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Type: Improvement

Poem

🐰 A backslash hops through special chars with care,
Escaping pipes, braces, and the at-sign there,
The tokenizer nibbles each clever pair,
The parser stitches letters fair and square,
From v12 onward, translations prance in air!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding escape sequence support to the message-compiler package, which is evidenced by tokenizer/parser updates and comprehensive test additions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/at-mark-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kazupon kazupon mentioned this pull request Feb 17, 2026
12 tasks
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Feb 17, 2026

Copy link
Copy Markdown

Deploying vue-i18n-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: 850eea1
Status: ✅  Deploy successful!
Preview URL: https://21561a96.vue-i18n-next.pages.dev
Branch Preview URL: https://feat-at-mark-support.vue-i18n-next.pages.dev

View logs

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
core.esm-browser.prod.js 43.44 kB (+0.33 kB) 12.46 kB (+0.07 kB) 11.12 kB (+0.05 kB)
core.global.prod.js 34.62 kB (+0.23 kB) 11.55 kB (+0.05 kB) 10.37 kB (+0.05 kB)
core.runtime.esm-browser.prod.js 26.15 kB 8.08 kB 7.24 kB
core.runtime.global.prod.js 19.75 kB 7.46 kB 6.70 kB
message-compiler.esm-browser.prod.js 23.42 kB (+0.33 kB) 6.50 kB (+0.08 kB) 5.83 kB (+0.07 kB)
message-compiler.global.prod.js 20.66 kB (+0.23 kB) 6.26 kB (+0.06 kB) 5.62 kB (+0.06 kB)
petite-vue-i18n-core.esm-browser.prod.js 22.47 kB 7.34 kB 6.59 kB
petite-vue-i18n-core.global.prod.js 17.10 kB 6.51 kB 5.87 kB
petite-vue-i18n.esm-browser.prod.js 42.29 kB (+0.33 kB) 12.32 kB (+0.08 kB) 11.03 kB (+0.05 kB)
petite-vue-i18n.global.prod.js 33.49 kB (+0.24 kB) 11.03 kB (+0.07 kB) 9.95 kB (+0.08 kB)
petite-vue-i18n.runtime.esm-browser.prod.js 24.86 kB 7.83 kB 7.09 kB
petite-vue-i18n.runtime.global.prod.js 18.62 kB 6.93 kB 6.27 kB
vue-i18n.esm-browser.prod.js 55.88 kB (+0.33 kB) 15.97 kB (+0.07 kB) 14.33 kB (+0.06 kB)
vue-i18n.global.prod.js 44.11 kB (+0.23 kB) 14.40 kB (+0.07 kB) 12.98 kB (+0.04 kB)
vue-i18n.runtime.esm-browser.prod.js 38.44 kB 11.50 kB 10.41 kB
vue-i18n.runtime.global.prod.js 29.23 kB 10.35 kB 9.34 kB

Usages

Name Size Gzip Brotli
packages/size-check-core (@intlify/core) 11.52 kB 4.55 kB 4.09 kB
packages/size-check-petite-vue-i18n (petite-vue-i18n) 83.61 kB 32.00 kB 28.83 kB
packages/size-check-vue-i18n (vue-i18n) 88.30 kB 33.31 kB 30.08 kB

@pkg-pr-new

pkg-pr-new Bot commented Feb 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@intlify/core

npm i https://pkg.pr.new/@intlify/core@2394

@intlify/core-base

npm i https://pkg.pr.new/@intlify/core-base@2394

@intlify/devtools-types

npm i https://pkg.pr.new/@intlify/devtools-types@2394

@intlify/message-compiler

npm i https://pkg.pr.new/@intlify/message-compiler@2394

petite-vue-i18n

npm i https://pkg.pr.new/petite-vue-i18n@2394

@intlify/shared

npm i https://pkg.pr.new/@intlify/shared@2394

vue-i18n

npm i https://pkg.pr.new/vue-i18n@2394

@intlify/vue-i18n-core

npm i https://pkg.pr.new/@intlify/vue-i18n-core@2394

commit: 850eea1

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/jp/guide/essentials/number.md`:
- Around line 50-52: Update the broken link in
docs/jp/guide/essentials/number.md: replace the target
../../../api/vue/interfaces/ComponentCustomProperties.md#n with
../../../api/v11/injection.md#n (the anchor `#n` is correct and comes from the
heading "### $n(value)"); ensure the markdown link surrounding `$n` now points
to ../../../api/v11/injection.md#n and verify the destination file exists and
the heading generates the same anchor.
- Around line 167-168: Replace the broken API reference link found in the note
block that mentions `i18n-n` (the `[!NOTE]` paragraph) so it points to the
DefineNumberFormat anchor in the v11 API general documentation instead of the
non-existent type-aliases path; update the link target to reference the
DefineNumberFormat section using the `#definenumberformat` anchor in the API v11
general doc.

In `@docs/jp/guide/essentials/syntax.md`:
- Around line 337-343: The table row for the pipe escape is inconsistent: the
escape column shows `\|` but the result column also shows `\|`, while the
rendered example should be a literal pipe `|`. Update the table row that uses
the escape symbol `\|` so its result cell is `|` (and keep the description
"リテラルのパイプ"), ensuring the escape→result mapping reads "`\|` → `|`".

In `@docs/zh/guide/advanced/composition.md`:
- Line 65: The API link for the Composer reference is incorrect: update the
markdown link in the sentence referencing useI18n/Composer to point to
../../../api/v11/composition.md instead of
../../../api/general/interfaces/Composer.md, and ensure the anchors for t, d,
and n (e.g., ../../../api/v11/composition.md#t, `#d`, `#n`) are used where
appropriate so the Composer (useI18n) API, including t/d/n examples, resolves
correctly.

In `@docs/zh/guide/essentials/syntax.md`:
- Around line 337-343: The table row for the pipe escape is inconsistent: the
"结果" column currently shows `\|` but the example renders a literal `|`; update
the table row so the result column is `|` (no backslash) to match rendered
behavior, i.e., edit the row containing `\|` in the diff so its second cell is
`|` and keep the first cell as `\|` to show the escape sequence.

Comment on lines 50 to 52
> [!TIP]
> `$n` にはいくつかのオーバーロードがあります。これらのオーバーロードについては、[API リファレンス](../../api/vue/interfaces/ComponentCustomProperties.md#n) を参照してください。
> `$n` にはいくつかのオーバーロードがあります。これらのオーバーロードについては、[API リファレンス](../../../api/vue/interfaces/ComponentCustomProperties.md#n) を参照してください。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, locate the ComponentCustomProperties.md file
fd -t f "ComponentCustomProperties.md"

Repository: intlify/vue-i18n

Length of output: 42


🏁 Script executed:

# Once located, examine the file for headings related to $n
cat -n docs/api/vue/interfaces/ComponentCustomProperties.md | head -100

Repository: intlify/vue-i18n

Length of output: 144


🏁 Script executed:

# Search for ComponentCustomProperties anywhere in the repo
fd -t f "ComponentCustomProperties"

Repository: intlify/vue-i18n

Length of output: 42


🏁 Script executed:

# Check the api directory structure
find docs/api -type d | head -20

Repository: intlify/vue-i18n

Length of output: 81


🏁 Script executed:

# Search for files with similar patterns
fd -t f ".*\.md$" docs/api | head -30

Repository: intlify/vue-i18n

Length of output: 212


🏁 Script executed:

# Search for $n references in API docs
rg -n '\$n' docs/api/v11/

Repository: intlify/vue-i18n

Length of output: 2088


🏁 Script executed:

# Check the injection.md file since it was mentioned in the learning
head -100 docs/api/v11/injection.md

Repository: intlify/vue-i18n

Length of output: 2675


🏁 Script executed:

# Check the actual file being reviewed
cat -n docs/jp/guide/essentials/number.md | sed -n '45,60p'

Repository: intlify/vue-i18n

Length of output: 643


Fix the broken link path and verify the anchor.

The link targets a non-existent file path. The correct path should be ../../../api/v11/injection.md#n (not ../../../api/vue/interfaces/ComponentCustomProperties.md#n). The API documentation is structured under docs/api/v11/, and $n overloads are documented in injection.md. The anchor #n is correct for that file, as VitePress generates it from the heading ### $n(value).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/jp/guide/essentials/number.md` around lines 50 - 52, Update the broken
link in docs/jp/guide/essentials/number.md: replace the target
../../../api/vue/interfaces/ComponentCustomProperties.md#n with
../../../api/v11/injection.md#n (the anchor `#n` is correct and comes from the
heading "### $n(value)"); ensure the markdown link surrounding `$n` now points
to ../../../api/v11/injection.md#n and verify the destination file exists and
the heading generates the same anchor.

Comment on lines 167 to +168
> [!NOTE]
> サポートされているスコープ付きスロットの完全なリストおよびその他の `i18n-n` プロパティは、[API リファレンス](../../api/general/type-aliases/NumberFormat.md) にあります。
> サポートされているスコープ付きスロットの完全なリストおよびその他の `i18n-n` プロパティは、[API リファレンス](../../../api/general/type-aliases/NumberFormat.md) にあります。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm the file exists and inspect headings for anchor correctness.
ls -la docs/api/general/type-aliases/NumberFormat.md
rg -n -C2 '^#{1,6}\s' docs/api/general/type-aliases/NumberFormat.md

Repository: intlify/vue-i18n

Length of output: 238


🏁 Script executed:

#!/bin/bash
# Search for NumberFormat in the docs directory
fd -t f 'NumberFormat' docs/ 2>/dev/null | head -20

# Explore the api directory structure
echo "=== docs/api directory structure ==="
find docs/api -type d | head -20

# Search for files that mention NumberFormat
echo "=== Files mentioning NumberFormat ==="
rg -l 'NumberFormat' docs/ | head -20

Repository: intlify/vue-i18n

Length of output: 792


🏁 Script executed:

#!/bin/bash
# List files in docs/api/v11
echo "=== docs/api/v11 structure ==="
find docs/api/v11 -type f | sort

# Search for NumberFormat in docs/api/v11
echo "=== Files in docs/api/v11 mentioning NumberFormat ==="
rg -l 'NumberFormat' docs/api/v11/

Repository: intlify/vue-i18n

Length of output: 424


🏁 Script executed:

#!/bin/bash
# Find the NumberFormat heading in general.md
rg -n -C3 'NumberFormat' docs/api/v11/general.md | head -40

# Also check for any headings near NumberFormat
echo "=== Headings in general.md ==="
rg -n '^#{1,6}\s' docs/api/v11/general.md

Repository: intlify/vue-i18n

Length of output: 4146


🏁 Script executed:

#!/bin/bash
# Search for NumberFormat headings
rg -n '^##\s.*NumberFormat' docs/api/v11/general.md

# Get context around DefineNumberFormat heading
echo "=== Context around DefineNumberFormat ==="
rg -n -A5 '^## DefineNumberFormat' docs/api/v11/general.md

# Check if there's a base NumberFormat heading anywhere
rg -n '^##\s+NumberFormat$' docs/api/v11/general.md

Repository: intlify/vue-i18n

Length of output: 243


🏁 Script executed:

#!/bin/bash
# Search for NumberFormat type definitions across API docs
rg -n 'interface NumberFormat|type NumberFormat|export.*NumberFormat' docs/api/v11/

# Also check the Japanese version to see if there's a pattern
echo "=== Japanese API docs ==="
rg -n 'NumberFormat' docs/jp/api/v11/general.md | head -10

Repository: intlify/vue-i18n

Length of output: 5436


🏁 Script executed:

#!/bin/bash
# Check current links in the Japanese number.md file
echo "=== Current links in docs/jp/guide/essentials/number.md ==="
rg '\[.*\]\(' docs/jp/guide/essentials/number.md | head -10

# Verify the relative path calculation
echo "=== Verifying path structure ==="
echo "From: docs/jp/guide/essentials/number.md"
echo "To: docs/api/v11/general.md"
echo "Relative path should be: ../../../api/v11/general.md"

# Check if there are any NumberFormat-related links in other docs
echo "=== NumberFormat links in other documentation ==="
rg 'api/v11.*NumberFormat|general\.md.*NumberFormat' docs/

Repository: intlify/vue-i18n

Length of output: 894


Fix broken API reference link path.

The link at lines 167-168 points to a non-existent file path. The docs/api/general/type-aliases/ directory does not exist; API documentation is located under docs/api/v11/. The correct link should be ../../../api/v11/general.md#definenumberformat (targeting the DefineNumberFormat section).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/jp/guide/essentials/number.md` around lines 167 - 168, Replace the
broken API reference link found in the note block that mentions `i18n-n` (the
`[!NOTE]` paragraph) so it points to the DefineNumberFormat anchor in the v11
API general documentation instead of the non-existent type-aliases path; update
the link target to reference the DefineNumberFormat section using the
`#definenumberformat` anchor in the API v11 general doc.

Comment on lines +337 to +343
| エスケープ | 結果 | 説明 |
|-----------|------|------|
| `\{` | `{` | リテラルの開き波括弧 |
| `\}` | `}` | リテラルの閉じ波括弧 |
| `\@` | `@` | リテラルのアットマーク |
| `\|` | `\|` | リテラルのパイプ |
| `\\` | `\` | リテラルのバックスラッシュ |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Escape table row for \| should likely render |.

The example output shows a literal pipe, but the table lists \| as the result. Consider aligning the table with the actual render.

✅ Suggested doc fix
-| `\|` | `\|` | リテラルのパイプ |
+| `\|` | `|` | リテラルのパイプ |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| エスケープ | 結果 | 説明 |
|-----------|------|------|
| `\{` | `{` | リテラルの開き波括弧 |
| `\}` | `}` | リテラルの閉じ波括弧 |
| `\@` | `@` | リテラルのアットマーク |
| `\|` | `\|` | リテラルのパイプ |
| `\\` | `\` | リテラルのバックスラッシュ |
| エスケープ | 結果 | 説明 |
|-----------|------|------|
| `\{` | `{` | リテラルの開き波括弧 |
| `\}` | `}` | リテラルの閉じ波括弧 |
| `\@` | `@` | リテラルのアットマーク |
| `\|` | `|` | リテラルのパイプ |
| `\\` | `\` | リテラルのバックスラッシュ |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/jp/guide/essentials/syntax.md` around lines 337 - 343, The table row for
the pipe escape is inconsistent: the escape column shows `\|` but the result
column also shows `\|`, while the rendered example should be a literal pipe `|`.
Update the table row that uses the escape symbol `\|` so its result cell is `|`
(and keep the description "リテラルのパイプ"), ensuring the escape→result mapping reads
"`\|` → `|`".

你必须在 `<script setup>` 的顶部调用 `useI18n`。

`useI18n` 返回一个 Composer 实例。Composer 实例提供翻译 API(如 `t` 函数)以及 `locale` 和 `fallbackLocale` 等属性,就像 VueI18n 实例一样。有关 Composer 实例的更多信息,请参阅 [API 参考](../../api/general/interfaces/Composer.md)。
`useI18n` 返回一个 Composer 实例。Composer 实例提供翻译 API(如 `t` 函数)以及 `locale` 和 `fallbackLocale` 等属性,就像 VueI18n 实例一样。有关 Composer 实例的更多信息,请参阅 [API 参考](../../../api/general/interfaces/Composer.md)。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Locate Composer.md and confirm the relative path target exists.
echo "=== Searching for Composer.md files ==="
fd -a 'Composer\.md' docs

echo ""
echo "=== Path verification ==="
# Show the resolved path for this file and the target to verify relative depth.
python3 - <<'PY'
import os
src = 'docs/zh/guide/advanced/composition.md'
target = 'docs/api/general/interfaces/Composer.md'
print('Source file exists:', os.path.exists(src))
print('Target file exists:', os.path.exists(target))
src_dir = os.path.dirname(src)
resolved_path = os.path.normpath(os.path.join(src_dir, '../../../api/general/interfaces/Composer.md'))
print('Resolved path from source:', resolved_path)
print('Resolved path exists:', os.path.exists(resolved_path))
PY

echo ""
echo "=== Directory structure of docs/api ==="
find docs/api -type d | head -20

echo ""
echo "=== Check if Composer.md exists and its location ==="
find docs -name 'Composer.md' -type f

Repository: intlify/vue-i18n

Length of output: 389


🏁 Script executed:

#!/bin/bash
# Check what's in docs/api/v11
echo "=== Contents of docs/api/v11 ==="
ls -la docs/api/v11

echo ""
echo "=== Search for files mentioning Composer ==="
rg 'Composer' docs --type md -l | head -20

echo ""
echo "=== Check git history for this file to see if path changed ==="
git log --oneline -n 10 -- docs/zh/guide/advanced/composition.md

echo ""
echo "=== Show recent changes to this file ==="
git show HEAD:docs/zh/guide/advanced/composition.md | head -100

Repository: intlify/vue-i18n

Length of output: 3539


🏁 Script executed:

#!/bin/bash
echo "=== Search for 'Composer' in docs/api/v11/composition.md ==="
rg 'Composer|^## .*\bt\b|^## .*\bd\b|^## .*\bn\b' docs/api/v11/composition.md | head -30

echo ""
echo "=== Search for 'Composer' in docs/api/v11/general.md ==="
rg 'Composer|^## .*\bt\b|^## .*\bd\b|^## .*\bn\b' docs/api/v11/general.md | head -30

echo ""
echo "=== List all heading levels in docs/api/v11/composition.md ==="
rg '^\#+\s+' docs/api/v11/composition.md | head -40

echo ""
echo "=== Check for interface definitions ==="
rg 'interface Composer|class Composer' docs/api/v11/*.md

Repository: intlify/vue-i18n

Length of output: 5724


Fix incorrect API reference path.

The link path ../../../api/general/interfaces/Composer.md is broken—the file does not exist. The Composer API documentation is located at ../../../api/v11/composition.md instead. The anchors #t, #d, and #n already exist in that file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/zh/guide/advanced/composition.md` at line 65, The API link for the
Composer reference is incorrect: update the markdown link in the sentence
referencing useI18n/Composer to point to ../../../api/v11/composition.md instead
of ../../../api/general/interfaces/Composer.md, and ensure the anchors for t, d,
and n (e.g., ../../../api/v11/composition.md#t, `#d`, `#n`) are used where
appropriate so the Composer (useI18n) API, including t/d/n examples, resolves
correctly.

Comment on lines +337 to +343
| 转义 | 结果 | 描述 |
|------|------|------|
| `\{` | `{` | 字面量左大括号 |
| `\}` | `}` | 字面量右大括号 |
| `\@` | `@` | 字面量 @ 符号 |
| `\|` | `\|` | 字面量管道符 |
| `\\` | `\` | 字面量反斜杠 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Escape table row for \| looks inconsistent with the example output.

The “结果” column shows \|, but the example renders a literal |. The result should likely be | (without the backslash) to match behavior.

✅ Suggested doc fix
-| `\|` | `\|` | 字面量管道符 |
+| `\|` | `|` | 字面量管道符 |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 转义 | 结果 | 描述 |
|------|------|------|
| `\{` | `{` | 字面量左大括号 |
| `\}` | `}` | 字面量右大括号 |
| `\@` | `@` | 字面量 @ 符号 |
| `\|` | `\|` | 字面量管道符 |
| `\\` | `\` | 字面量反斜杠 |
| 转义 | 结果 | 描述 |
|------|------|------|
| `\{` | `{` | 字面量左大括号 |
| `\}` | `}` | 字面量右大括号 |
| `\@` | `@` | 字面量 @ 符号 |
| `\|` | `|` | 字面量管道符 |
| `\\` | `\` | 字面量反斜杠 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/zh/guide/essentials/syntax.md` around lines 337 - 343, The table row for
the pipe escape is inconsistent: the "结果" column currently shows `\|` but the
example renders a literal `|`; update the table row so the result column is `|`
(no backslash) to match rendered behavior, i.e., edit the row containing `\|` in
the diff so its second cell is `|` and keep the first cell as `\|` to show the
escape sequence.

@kazupon kazupon merged commit 5c8eacd into master Feb 17, 2026
36 checks passed
@kazupon kazupon deleted the feat/at-mark-support branch February 17, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature Includes new features v11:backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant