Skip to content

Conversation

@whjstc
Copy link

@whjstc whjstc commented Jan 5, 2026

Description

Bilingual Formatter is a Raycast extension that automatically corrects Chinese-English mixed typography based on the Chinese Copywriting Guidelines.

Key Features

  • ✅ Automatically adds spaces between Chinese and English characters
  • ✅ Converts full-width to half-width characters (numbers, letters)
  • ✅ Normalizes Chinese/English punctuation marks
  • ✅ Smart quote pairing and conversion (to Chinese corner quotes「」)
  • ✅ Protects Markdown code blocks, inline code, URLs, and file paths
  • ✅ Supports Greek letters (α, β, γ, etc.)

Three Convenient Commands

  1. Format Clipboard - Format clipboard content and copy back
  2. Format and Paste - Format clipboard content and paste to active app
  3. Format Text - Interactive UI to input and format text

Use Cases

Perfect for writing technical documentation, blog posts, and any content that mixes Chinese and English text.

Example

Before:
在LeanCloud上,数据存储是围绕AVObject进行的。每个AVObject都包含了与JSON兼容的key-value对应的数据。

After:
在 LeanCloud 上,数据存储是围绕 AVObject 进行的。每个 AVObject 都包含了与 JSON 兼容的 key-value 对应的数据。

Technical Highlights

  • Architecture: Chain of Responsibility pattern with 5 specialized correctors
  • Testing: 15 test cases with 100% pass rate
  • Performance: Processes 64K characters in ~19ms
  • Type Safety: Full TypeScript coverage
  • Quality: All lint checks passing

Screencast

The extension includes 2 screenshots (2000x1250px) in the metadata folder showing:

  1. The Format Text command interface
  2. Before/after formatting example

(Screenshots will be automatically displayed in the Raycast Store)

Checklist

whjstc added 2 commits January 5, 2026 18:31
- Fix author username
- Initial commit
- Restructure extension to follow Raycast extensions repository standards
- Fix assets path and resize screenshots
- Add bilingual-formatter extension
- Add bilingual-formatter extension
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Jan 5, 2026
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@whjstc whjstc marked this pull request as ready for review January 5, 2026 13:16
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 5, 2026

Greptile Summary

This PR adds a new Bilingual Formatter extension that automatically corrects Chinese-English mixed typography based on the Chinese Copywriting Guidelines. The extension provides three commands: Format Clipboard, Format and Paste, and Format Text (interactive UI).

Architecture:

  • Implements Chain of Responsibility pattern with 5 specialized correctors (SpaceCorrector, CharacterCorrector, PunctuationCorrector, QuoteCorrector)
  • Uses placeholder-based protection for markdown elements (code blocks, inline code, URLs, file paths)
  • Full TypeScript coverage with comprehensive test suite

Key Features:

  • Adds spaces between Chinese and English characters
  • Converts full-width to half-width characters
  • Normalizes Chinese/English punctuation marks
  • Smart quote pairing and conversion to Chinese corner quotes (「」)
  • Supports Greek letters (α, β, γ)

Issue Found:

  • Duplicate asset files exist in nested assets/assets/ folder that should be removed

Confidence Score: 4/5

  • This PR is safe to merge after removing duplicate asset files
  • The code quality is excellent with clean architecture, proper error handling, and comprehensive tests. The implementation correctly handles complex text formatting logic with markdown protection. Score reduced from 5 to 4 due to duplicate asset files in assets/assets/ folder that need to be removed before merging.
  • Remove duplicate files: extensions/bilingual-formatter/assets/assets/icon.png and extensions/bilingual-formatter/assets/assets/icon.svg

Important Files Changed

Filename Overview
extensions/bilingual-formatter/package.json Configuration looks good - proper dependencies, commands, and metadata defined
extensions/bilingual-formatter/assets/assets/icon.png Duplicate asset file - should not exist in nested assets/assets/ folder
extensions/bilingual-formatter/assets/assets/icon.svg Duplicate asset file - should not exist in nested assets/assets/ folder
extensions/bilingual-formatter/src/services/formatter-service.ts Well-structured formatter service with proper chain of correctors
extensions/bilingual-formatter/src/format-clipboard.ts Clean clipboard formatting command with proper error handling

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. extensions/bilingual-formatter/assets/assets/icon.png, line 1 (link)

    syntax: Remove duplicate asset files in nested assets/assets/ folder. Assets should only exist in assets/ directory, not in a nested subdirectory. The same icon files are already present at assets/icon.png and assets/icon.svg.

28 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants