# 文本中的多余空格

**URL:** https://meta.discourse.org/t/extra-spaces-within-text/397551
**Category:** Support
**Created:** [2026年三月3日 17:00 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551 "2026-03-03T17:00:21Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Steve\_Walmsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steve_walmsley/32/484521_2.png) [@Steve\_Walmsley](https://meta.discourse.org/u/Steve_Walmsley)
#### Post date: [2026年三月3日 17:00 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/1 "2026-03-03T17:00:21Z")

</div>

出于格式化的原因，我想在单词之间添加额外的空格。Discourse 通常会删除这些空格，但有时这会提高可读性。我可以使用反引号，但这会改变字体。我可以使用 ![image](https://global.discourse-cdn.com/meta/original/4X/1/2/d/12d7039240dd0039c37c3857f11c8cacaa0fb98a.png)，但这在我下次编辑文本时会消失。

有没有一种方法可以在不改变字体的情况下，添加额外的单词间距并使其保持持久？

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [2026年三月3日 17:11 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/2 "2026-03-03T17:11:05Z")

</div>

`word-spacing: 1em;`

结果如下：

 ![CleanShot 2026-03-03 at 18.10.51@2x](https://global.discourse-cdn.com/meta/original/4X/c/9/b/c9b387d43871280f88e1164bad4ad1c4299ac3b5.png)

不知道你为什么要这么做 😜

---

<div class="post-metadata">

### Author: ![Steve\_Walmsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steve_walmsley/32/484521_2.png) [@Steve\_Walmsley](https://meta.discourse.org/u/Steve_Walmsley)
#### Post date: [2026年三月3日 17:13 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/3 "2026-03-03T17:13:07Z")

</div>

我正在写一份游戏行动后报告。报告包括行星上存在的矿物及其可开采性。在 Word 中看起来是这样（截图）。

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/8/1/581abd3e9db1090575d805843744ecfbafc3071c.png)

在 Discourse 中看起来是这样。

**地球勘测报告**

杜拉尼姆 (Duranium): 374,100 1.00

中子素 (Neutronium): 121,600 0.60

科博矿 (Corbomite): 148,400 0.90

氚化铁 (Tritanium): 183,700 0.70

硼化铁 (Boronide): 146,400 0.90

汞化铁 (Mercassium): 124,500 0.80

凡达石 (Vendarite): 125,600 0.70

钍 (Sorium): 166,700 0.80

铀 (Uridium): 105,200 0.70

刚玉 (Corundium): 275,000 0.70

镓石 (Gallicite): 406,000 0.90

我可以删除多余的行，但数字之间的空格更易读。

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [2026年三月3日 17:15 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/4 "2026-03-03T17:15:53Z")

</div>

啊，好的，你的意思是特指在编辑器中，所以你可以选择在何时何地添加它们？

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2026年三月3日 17:17 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/5 "2026-03-03T17:17:41Z")

</div>

关于表格呢？

**地球勘测报告**

| 材料 | 数值 | 修正值 |
| --- | --- | --- |
| 杜拉尼姆 (Duranium) | 374,100 | 1.00 |
| 中子素 (Neutronium) | 121,600 | 0.60 |
| 科博米特 (Corbomite) | 148,400 | 0.90 |
| 三钛 (Tritanium) | 183,700 | 0.70 |
| 硼化物 (Boronide) | 146,400 | 0.90 |
| 汞化镧 (Mercassium) | 124,500 | 0.80 |
| 文达石 (Vendarite) | 125,600 | 0.70 |
| 索钌 (Sorium) | 166,700 | 0.80 |
| 铀化铁 (Uridium) | 105,200 | 0.70 |
| 刚玉 (Corundium) | 275,000 | 0.70 |
| 镓石 (Gallicite) | 406,000 | 0.90 |

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [2026年三月3日 17:18 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/6 "2026-03-03T17:18:07Z")

</div>

> [@Steve\_Walmsley](#):
>
> 我可以使用反引号，但这会改变字体。

如果你在其他地方不使用反引号，你可以直接覆盖它们的 CSS。

这可能是最简单的方法。

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [2026年三月3日 17:48 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/7 "2026-03-03T17:48:44Z")

</div>

您也可以在报告周围放置一个命名的 `wrap` 并为其应用 CSS：

> ![image](https://global.discourse-cdn.com/meta/original/4X/6/7/2/6729e5181d92bd03593030a3a07f659508e607b9.png)

我在 Markdown 编辑器中发现这样做最简单：

```plaintext
[wrap=game-report]

Duranium: 374,100 1.00

Neutronium: 121,600 0.60

Corbomite: 148,400 0.90

...等等。

[/wrap]

```

添加您的自定义 CSS：

```css
[data-wrap="game-report"] {
    word-spacing: 1em;
}

```

结果：

> ![image](https://global.discourse-cdn.com/meta/original/4X/e/f/5/ef5af69581f2e0d30ec87d2e724dd0dc6a169f48.png)

---

<div class="post-metadata">

### Author: ![Steve\_Walmsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steve_walmsley/32/484521_2.png) [@Steve\_Walmsley](https://meta.discourse.org/u/Steve_Walmsley)
#### Post date: [2026年三月3日 18:12 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/8 "2026-03-03T18:12:04Z")

</div>

是的，在我回到这里之前，我就独立得出了这个解决方案。这对我所需的功能来说要好得多。谢谢。

我真的需要开始好好学习标记语言了。我的背景是 C++/C# 等。

而且我刚刚对游戏进行了编程，使其可以生成包含表格 Markdown 的调查数据 🙂

---

<div class="post-metadata">

### Author: ![Steve\_Walmsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steve_walmsley/32/484521_2.png) [@Steve\_Walmsley](https://meta.discourse.org/u/Steve_Walmsley)
#### Post date: [2026年三月3日 18:17 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/9 "2026-03-03T18:17:16Z")

</div>

谢谢，这也是一个有趣的解决方案。我对 CSS 一点经验都没有。我还需要学习一些别的东西 🙂

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [2026年三月3日 18:25 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/10 "2026-03-03T18:25:13Z")

</div>

[在您的网站上进行自定义 CSS 更改](https://meta.discourse.org/t/making-custom-css-changes-on-your-site/168101) 是一篇很好的入门和指南。

---

<div class="post-metadata">

### Author: ![Steve\_Walmsley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steve_walmsley/32/484521_2.png) [@Steve\_Walmsley](https://meta.discourse.org/u/Steve_Walmsley)
#### Post date: [2026年三月3日 18:36 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/11 "2026-03-03T18:36:45Z")

</div>

谢谢——这看起来非常有趣。我已经收藏了，我会花些时间研究一下。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2026年四月2日 18:37 UTC](https://meta.discourse.org/t/extra-spaces-within-text/397551/12 "2026-04-02T18:37:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
