Feature #43234
openEnable CJK-friendly emphasis extension for CommonMark
0%
Description
This patch enables the CJK-friendly emphasis extension in commonmarker to properly parse Markdown emphasis (**
) with CJK (Chinese, Japanese, Korean) characters. This resolves a known issue where emphasis marks were not correctly interpreted when adjacent to CJK characters, such as in **テスト。**テスト
.
Input:
Before:
After:
I believe this will help improve the user experience for CJK language users.
According to the documentation for the package that this extension is based on, enabling it does not affect languages other than CJK.
This modification of the specification does not affect the other languages than Chinese, Japanese, and Korean. Even if your application or document has translations or content in other languages, it will not be affected
I have also verified its functionality with English, Spanish, and French, and found no issues. All tests have passed with this patch.
https://github.com/hidakatsuya/redmine/actions/runs/17896214845
diff --git a/Gemfile b/Gemfile
index 9cde32ec8..add1363f7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -18,7 +18,7 @@ gem 'propshaft', '~> 1.1.0'
gem 'rack', '>= 3.1.3'
gem "stimulus-rails", "~> 1.3"
gem "importmap-rails", "~> 2.0"
-gem 'commonmarker', '~> 2.3.0'
+gem 'commonmarker', '~> 2.3.2'
gem "doorkeeper", "~> 5.8.2"
gem "bcrypt", require: false
gem "doorkeeper-i18n", "~> 5.2"
diff --git a/lib/redmine/wiki_formatting/common_mark/formatter.rb b/lib/redmine/wiki_formatting/common_mark/formatter.rb
index 8b7a18394..2b5f3f163 100644
--- a/lib/redmine/wiki_formatting/common_mark/formatter.rb
+++ b/lib/redmine/wiki_formatting/common_mark/formatter.rb
@@ -35,6 +35,7 @@ module Redmine
tasklist: true,
shortcodes: false,
alerts: true,
+ cjk_friendly_emphasis: true,
}.freeze,
# https://github.com/gjtorikian/commonmarker#parse-options
Files
Updated by Marius BĂLTEANU 3 days ago
- Target version set to Candidate for next minor release
Updated by Katsuya HIDAKA 2 days ago
- File 0002-Add-test-for-enabling-CJK-friendly-emphasis-extension.patch 0002-Add-test-for-enabling-CJK-friendly-emphasis-extension.patch added
I'm attaching patch 0002, which adds a test to confirm that the CJK-friendly emphasis extension is enabled. Please consider fixuping this patch into patch 0001 when committing.
All tests have been confirmed to pass:
https://github.com/hidakatsuya/redmine/actions/runs/17953931078
Updated by Marius BĂLTEANU 1 day ago
- Target version changed from Candidate for next minor release to 6.1.1
Updated by Marius BĂLTEANU about 15 hours ago
- Status changed from New to Resolved
- Resolution set to Fixed