fix(theme): disable text-autospace in <code>, <kbd>, and <samp>#3254
Merged
SoonIter merged 1 commit intoweb-infra-dev:mainfrom Mar 24, 2026
Merged
fix(theme): disable text-autospace in <code>, <kbd>, and <samp>#3254SoonIter merged 1 commit intoweb-infra-dev:mainfrom
text-autospace in <code>, <kbd>, and <samp>#3254SoonIter merged 1 commit intoweb-infra-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the default theme CSS so CJK/Latin autospace behavior doesn’t disrupt inline/semantic code-like elements, aligning Rspress’ styling with emerging CSS default stylesheet guidance and behavior seen in other doc tools (e.g., VitePress).
Changes:
- Disable
text-autospaceforcode,kbd, andsamp(in addition topre) in the base theme stylesheet. - Add
autospaceto the project dictionary. - Add a changeset to publish a patch release of
@rspress/core.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/dictionary.txt | Adds “autospace” to custom dictionary to avoid lint/spellcheck noise. |
| packages/core/src/theme/styles/base.css | Extends the text-autospace: no-autospace exception rule to code, kbd, samp. |
| .changeset/beige-parrots-slide.md | Declares a patch changeset for @rspress/core covering the theme fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5c7fe1b to
954ea96
Compare
Contributor
Author
|
Reformatted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
I get Qiita (a Japanese large technical knowledge-sharing platform for programmers, similar to China's CSDN or Juejin but focused on short, practical coding articles) adopt
text-autospacelike Rspress, but I noticed thattext-autospaceis not so welcomed in not only<pre>but also<code>:increments/qiita-discussions#1049 (comment) (Japanese)
These extra spaces cause the loss of cohesion between characters in the Japanese function name mixed with English
test_関数getRandomは1以上100以下の値を返す(meaning:test_函数getRandom返回1到100之间的值).VitePress has been turned off
text-autospacein not only<pre>but also<code>,<kbd>, and<samp>: vuejs/vitepress@21a5fb6In the first place, CSS also does not recommend us to apply
text-autospacethere: https://drafts.csswg.org/css-text-4/#default-stylesheetNote:
<tt>is deprecated.text-spacing=text-autospace+text-spacing-trimRelated Issue
<pre>: #3110 #3131Checklist