Wrap mixed English segments with inline code and insert CJK-adjacent spaces.
English | 中文
Obsidian plugin for mixed CJK–English typography. Inserts spaces at CJK–Latin boundaries and wraps English segments in inline code.
`inline code`Open the command palette and run 「中英混排:反引号包裹并补空格」 (Mixed CJK–English: wrap in backticks and add spaces).
Default shortcut: Cmd + Shift + S (macOS) / Ctrl + Shift + S (Windows / Linux).
Configure under Settings → Community plugins → Auto Spacer:
main.js, manifest.json, and styles.css from ReleasesYourVault/.obsidian/plugins/auto-spacer/
Source files alone are not enough—you must build
main.jsor download the compiled artifacts from a Release.
git clone https://github.com/fanthus/obsidian-auto-spacer.git
cd obsidian-auto-spacer
npm install
npm run dev
npm run dev watches and compiles src/main.ts to main.js. Reload Obsidian after code changes to test.
Production build:
npm run build
ESLint is configured. Run:
npm run lint
You can also use the Obsidian rules package eslint-plugin-obsidianmd. A GitHub Action runs lint on pushes to all branches.
This project uses release.mjs to build and create GitHub Releases. Obsidian downloads main.js, manifest.json, and styles.css from the release.
Repository: https://github.com/fanthus/obsidian-auto-spacer
gh auth login
npm install
Set the target version in manifest.json (e.g. 1.0.0), then run:
npm run release -- --push
The script will:
npm run build to produce main.js1.0.0—no v prefix)main.js, manifest.json, and styles.cssPick a bump type for your changes:
| Command | Version change | When to use |
|---|---|---|
npm run release:patch |
1.0.0 → 1.0.1 |
Bug fixes, small changes |
npm run release:minor |
1.0.0 → 1.1.0 |
New features, backward compatible |
npm run release:major |
1.0.0 → 2.0.0 |
Breaking changes |
These commands bump the version, sync manifest.json and versions.json, build, publish, and push.
Update minAppVersion in manifest.json before releasing if you require a newer Obsidian version.
Preview steps without publishing:
npm run release -- --dry-run
Custom release notes:
npm run release -- --bump patch --push --notes "Fix spacing around punctuation."
Read notes from a file:
npm run release -- --bump patch --push --notes-file CHANGELOG.md
Replace an existing release (e.g. after a failed publish):
npm run release -- --push --force
Full help:
node release.mjs --help
Without the script:
version in manifest.json"newVersion": "minObsidianVersion" to versions.jsonnpm run buildversion (e.g. 1.0.0)main.js, manifest.json, and styles.cssAfter a GitHub Release, submit your plugin on community.obsidian.md with the repository URL. See Submit your plugin.
Set fundingUrl in manifest.json to show sponsorship options:
{
"fundingUrl": "https://buymeacoffee.com"
}
Multiple links as an object:
{
"fundingUrl": {
"Buy Me a Coffee": "https://buymeacoffee.com",
"GitHub Sponsor": "https://github.com/sponsors",
"Patreon": "https://www.patreon.com/"
}
}
Obsidian plugin development: https://docs.obsidian.md