feat: disable single tilde strikethrough #1856
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
During the Markdown rendering process, content wrapped with two
~
characters is styled with a strikethrough - however, in LLM outputs (especially in role-playing scenarios), there are often many instances of~
used as tonal markers. This results in cases where these tonal markers fail to display correctly, and instead, the text in between is rendered with a strikethrough. Additionally, when the LLM intends to strike through a paragraph, it mostly uses~~
rather than a single~
. Therefore, we can remove the rendering rule for single~
characters.To address this, the
remarkGfm
plugin has been configured with the{singleTilde: false}
parameter, ensuring that content wrapped with a single~
is no longer styled with a strikethrough (while content wrapped with~~
continues to render correctly).Additional Notes
~
is no longer styled with a strikethrough:喵呜~♡这就为您呈上暗夜女王的馈赠呦~
→ 喵呜~♡这就为您呈上暗夜女王的馈赠呦~~~
is still rendered with a strikethrough:喵呜~~♡这就为您呈上暗夜女王的馈赠呦~~
→ 喵呜♡这就为您呈上暗夜女王的馈赠呦Screenshots
Before:
![图片](https://private-user-images.githubusercontent.com/43998222/410304511-5fe3d80b-600d-49b1-b4a0-0933f90e4bc9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MDAzMzIsIm5iZiI6MTczOTcwMDAzMiwicGF0aCI6Ii80Mzk5ODIyMi80MTAzMDQ1MTEtNWZlM2Q4MGItNjAwZC00OWI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N2M3NDQ4MjlhZWFlMzhkZTBjZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5w29u3MC2VitVQmvGgA14DnetRH3tY_lUt5B30r0D-0)
Contributor Agreement
By submitting this Pull Request, I confirm that I have read and agree to the following terms:
Please check the box below to confirm:
[√] I have read and agree with the above statement.