CJK Bold Fix
pendingby ebibibi
Fixes CJK (Chinese/Japanese/Korean) bold and italic rendering in Live Preview mode.
CJK Bold Fix
An Obsidian plugin that fixes bold and italic rendering for CJK (Chinese, Japanese, Korean) text in Live Preview mode.
The Problem
Obsidian's Live Preview (editing mode) uses CodeMirror 6, which follows the CommonMark specification for emphasis parsing. The CommonMark spec's "left-flanking" and "right-flanking" delimiter run rules were designed for space-separated languages like English and break when CJK punctuation appears adjacent to emphasis markers.
Examples of broken patterns
は、**知識があれば**です。 ← Doesn't render as bold
**テスト。**テスト ← Doesn't render as bold
これは**重要な**テキストです ← Doesn't render as bold
Note: Reading mode (preview) renders correctly — the bug only affects Live Preview (editing mode).
This is a known CommonMark issue (#650) with 235+ comments, unresolved for 7+ years.
How It Works
The plugin registers a CodeMirror 6 ViewPlugin that operates in 4 phases:
- Collect parser emphasis — Reads HyperMD syntax tree to find where the parser applied bold/italic
- Find correct emphasis — Uses per-line regex to determine where
**...**,*...*, and***...***patterns with CJK content should actually be - Override wrong emphasis — Applies
font-weight: normalto ranges the parser incorrectly bolded - Apply correct emphasis — Adds bold/italic styling and hides
**/*markers where the parser missed
Installation
From Community Plugins
Search for "CJK Bold Fix" in Obsidian's Community Plugins browser.
Manual Installation
- Download
main.jsandmanifest.jsonfrom the latest release - Create a folder
cjk-bold-fixin your vault's.obsidian/plugins/directory - Copy the files into that folder
- Enable the plugin in Obsidian's settings
Supported Languages
- Japanese (Hiragana, Katakana, Kanji)
- Chinese (Simplified & Traditional)
- Korean (Hangul)
Technical Details
- Approach: ViewPlugin + Decoration (no monkey-patching, no internal API dependencies)
- Performance: Only processes visible ranges, rebuilds only on document/viewport/selection changes
- Compatibility: Uses only official Obsidian plugin APIs (
registerEditorExtension) - Emphasis types: Bold (
**), italic (*), and bold+italic (***)
Related
- CommonMark Issue #650 — The upstream specification issue
- Obsidian Forum Discussion
- markdown-cjk-friendly — Spec-level fix for various parsers
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.