-
Notifications
You must be signed in to change notification settings - Fork 112
Description
- I have verified that I am on the latest version of the Linter
Describe the Bug
When the rule "Ensures that Chinese, Japanese, or Korean and English or numbers are separated by a single space (space-between-chinese-japanese-or-korean-and-english-or-numbers)" is enabled, Markdown emphasis syntax using asterisks (* or **) is corrupted — especially when multiple bold sections appear on the same line.
Instead of simply adding spaces between CJK and English text, the Linter breaks Markdown structure, causing duplication of ****, and even injecting raw placeholder strings like NG_PLACEHOLDER} or TRONG_PLACEHOLDER} into the document.
This behavior permanently damages the text after multiple lint runs.
How to Reproduce
Steps to reproduce the behavior:
- Open Obsidian with the Linter plugin installed.
- Enable the rule:
Ensures that Chinese, Japanese, or Korean and English or numbers are separated by a single space - Create a note containing multiple bold Markdown segments in one line, such as:
香港的大学体系受英国影响,**教学岗位(Instructor)**与**学术科研岗位(Professor Track)**是**两条不同晋升路径**。- Run the Linter for more than one time
- Observe the corrupted output, such as:
香港的大学体系受英国影响,**教学岗位(Instructor)**与**学术科研岗位(Professor Track)**是**两条不同晋升路径****与**NG_PLACEHOLDER}两条不同晋升路径****与**NG_PLACEHOLDER}两条不同晋升路径**与**LACEHOLDER}。Debug Logs
Expected Behavior
The Linter should not modify Markdown emphasis syntax or insert placeholders.
The following is the expected (correct) output:
香港的大学体系受英国影响,**教学岗位(Instructor)** 与 **学术科研岗位(Professor Track)** 是 **两条不同晋升路径**。
Device
- Desktop
- Mobile
Analysis (According to ChatGPT, NOT for sure)
The rule’s regex pattern likely matches asterisks (*) as ASCII characters when identifying CJK–English boundaries.
In lines with multiple Markdown emphasis sections (...), these regex captures split the ** tokens apart.
Linter temporarily replaces matched segments with placeholders (e.g. NG_PLACEHOLDER_1), but the placeholder count and positions no longer align after regex replacements.
When placeholders are restored, some fail to resolve, producing visible artifacts (NG_PLACEHOLDER}, duplicated ****).
Each additional lint pass processes these placeholders again, compounding corruption.