Punctilious

approved

by bozhang

统一 Markdown 标点格式:中文标点转英文标点,并在中英文与数字之间自动补空格,链接 URL 自动豁免。 - This plugin has not been manually reviewed by Obsidian staff.

24 downloadsUpdated 15d agoMIT

Obsidian Punctilious

Normalize Markdown punctuation: convert Chinese punctuation to English punctuation, add spaces between Chinese and English/digits, and leave URLs inside links untouched.

English | 中文

Features

  • Spaces around numbers: 共100元共 100 元
  • Spaces between Chinese and English: 使用TypeScript开发使用 TypeScript 开发
  • Chinese punctuation to English: 你好,世界。你好, 世界.
  • Automatic spacing after converted punctuation
  • Ideographic comma to comma: 苹果、香蕉苹果, 香蕉
  • Dashes and book title marks are preserved: ——, 《》
  • URLs in links are exempt: addresses inside Markdown links, images, Wiki links and bare URLs are never modified
  • Safe zones are protected: code blocks, inline code, math, HTML tags and comments, YAML frontmatter
  • Two scopes: format the whole note, or just the selected text

Installation

Manual installation

  1. Download main.js, manifest.json and styles.css from the latest release
  2. Create a punctilious folder inside your vault's .obsidian/plugins/
  3. Copy the downloaded files into that folder
  4. Reload Obsidian and enable the plugin in Settings → Community plugins

Usage

  1. Open a Markdown note
  2. Press Ctrl/Cmd + P to open the command palette
  3. Run one of the following commands:
CommandDescription
Normalize punctuation in current noteFormats the entire active note
Normalize punctuation in selectionFormats only the selected text; formats the whole note when nothing is selected

Formatting rules

1. Spaces around numbers

BeforeAfter
共100元共 100 元
总共3个苹果和12个梨总共 3 个苹果和 12 个梨
2026年是重要的一年2026 年是重要的一年
- 2026年计划- 2026 年计划

No leading space is added when the number sits at the beginning of a paragraph or a line.

2. Spaces between Chinese and English

BeforeAfter
使用TypeScript开发使用 TypeScript 开发
这是一个Obsidian插件这是一个 Obsidian 插件

No leading space is added when the English text sits at the beginning of a paragraph or a line. No space is inserted between English and digits (iPhone15, v1.2.3 stay as they are).

Existing spaces are never duplicated: 使用 TypeScript 开发 stays unchanged, and runs of multiple spaces collapse into one. When only one side has a space, just the missing side is filled in (for example 共 100元共 100 元).

3. Chinese punctuation to English punctuation

A space is added after the converted punctuation. Opening brackets and quotes get the space before them instead, and any redundant space before a closing mark is removed.

BeforeAfter
你好,世界。今天怎么样?你好, 世界. 今天怎么样?
第一项;第二项:第三项第一项; 第二项: 第三项
我(你)好我 (你) 好
中文(English)结尾中文 (English) 结尾
他说:“你好!”他说: "你好!"
等等……还有等等... 还有

Full conversion table:

ChineseEnglish
,
.
, (can be disabled in settings)
;
:
?
!
( )( / )
【 】[ / ]
〔 〕, 〖 〗[ / ]
〈 〉< / >
“ ”, 「 」 " / "
‘ ’, 『 』 ' / '
~
……...
——preserved
《 》preserved

4. URLs in links are exempt

URLs are never modified and never get extra spaces:

参见[链接](https://example.com/docs?a=1&b=2#中文)与[[笔记/2026计划|我的计划]]。

becomes:

参见[链接](https://example.com/docs?a=1&b=2#中文)与[[笔记/2026计划|我的计划]].

Exempt content also includes image URLs, reference-style link definitions, <https://...> autolinks, bare URLs and Wiki link targets.

5. Zones preserved as-is

  • YAML frontmatter
  • Fenced code blocks (``` / ~~~) and inline code (`)
  • Math ($$...$$ / $...$)
  • HTML tags and HTML comments
  • Obsidian comments (%%...%%)
  • Markdown block markers (indentation, blockquotes, headings, lists, task lists, footnote definitions) and hard line breaks (two trailing spaces)

Settings

Open Settings → Punctilious to tune the rules.

SettingDefaultDescription
Add spaces between Chinese and English/digitsOnNo space is added at the start of a line
Convert Chinese punctuation to EnglishOnDashes and book title marks are always preserved
Add a space after punctuationOnAdds a space after the converted punctuation
Convert ideographic comma to commaOnTurn off to keep as-is
Skip code blocks and mathOnCode and math are left untouched
Skip URLs in linksOnLink addresses are left untouched
Skip YAML frontmatterOnFrontmatter is left untouched
Show completion noticeOnShows a notice when formatting finishes

Requirements

  • Obsidian v1.6.6 or later
  • Works on desktop and mobile

Security & privacy

  • Fully offline: no network requests at all
  • Only reads and writes the note you are working on; never scans or uploads vault content
  • No telemetry and no user data collection
  • All settings are stored locally in data.json

Development

# Install dependencies
npm install

# Build in watch mode
npm run dev

# Production build
npm run build

# Lint
npm run lint

Continuous integration

The project ships with two GitHub Actions workflows:

WorkflowTriggerDescription
.github/workflows/lint.ymlPush and pull request on any branchRuns npm ci, npm run build and npm run lint on Node.js 20.x / 22.x
.github/workflows/release.ymlTag pushBuilds the plugin and uploads main.js, manifest.json, styles.css and a zip archive as release assets

Releasing a new version

npm version runs version-bump.mjs, which keeps manifest.json and versions.json in sync:

npm version patch   # or minor / major
git push --follow-tags

Pushing the tag triggers the release workflow. The tag must match the version in manifest.json exactly (no leading v).

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.