fix(theme): disable text-autospace in pre elements#3131
Merged
Conversation
text-autospace: normal on :root causes unwanted spacing between CJK and non-CJK characters in preformatted text, breaking ASCII art and monospaced alignment in code blocks. Disable it in <pre> as the W3C spec intends.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses rspress issue #3110 by preventing text-autospace from affecting ASCII-art / alignment-sensitive content inside <pre> blocks in the default theme styles.
Changes:
- Add a
pre { text-autospace: no-autospace; }rule to disable autospace behavior within<pre>.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying rspress-v2 with
|
| Latest commit: |
ff53615
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://568a9af3.rspress-v2.pages.dev |
| Branch Preview URL: | https://syt-vibe-kanban-a455-issue.rspress-v2.pages.dev |
Contributor
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
Timeless0911
approved these changes
Feb 11, 2026
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
Related Issue
close #3110
Checklist
AI Summary
Rspress sets
text-autospace: normalon:rootto improve spacing between CJK (Chinese/Japanese/Korean) and non-CJK characters. However, this also applies to<pre>elements, which causes unwanted extra spacing in code blocks and ASCII art when using CJK-capable monospace fonts.Changes
text-autospace: no-autospacetopreelements inpackages/core/src/theme/styles/base.cssWhy
The
text-autospaceproperty inserts spaces between CJK and non-CJK characters, which breaks monospaced alignment in preformatted text blocks (code blocks, ASCII art, etc.). The W3C CSS spec itself plans to exclude<pre>from defaulttext-autospacebehavior. This fix aligns Rspress with the spec's intended behavior.This PR was written using Vibe Kanban