CJK Bold Fix

by ebibibi
5
4
3
2
1
Score: 35/100

Description

This plugin has not been manually reviewed by Obsidian staff. Fixes CJK (Chinese/Japanese/Korean) bold and italic rendering in Live Preview mode.

Reviews

No reviews yet.

Stats

stars
677
downloads
0
forks
1
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

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 (***)

License

MIT