CJK Bold Fix

pending

by ebibibi

Fixes CJK (Chinese/Japanese/Korean) bold and italic rendering in Live Preview mode.

4 starsUpdated 1mo agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

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:

  1. Collect parser emphasis — Reads HyperMD syntax tree to find where the parser applied bold/italic
  2. Find correct emphasis — Uses per-line regex to determine where **...**, *...*, and ***...*** patterns with CJK content should actually be
  3. Override wrong emphasis — Applies font-weight: normal to ranges the parser incorrectly bolded
  4. 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

  1. Download main.js and manifest.json from the latest release
  2. Create a folder cjk-bold-fix in your vault's .obsidian/plugins/ directory
  3. Copy the files into that folder
  4. 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

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.