# 有没有简单的方法可以保留诗歌开头的空格和其他格式？

**URL:** <https://meta.discourse.org/t/is-there-a-simple-way-to-not-strip-leading-spaces-and-other-formatting-in-a-poem/407991>\
**Category:** Support\
**Tags:** composer\
**Created:** [2026年七月20日 00:06 UTC](https://meta.discourse.org/t/is-there-a-simple-way-to-not-strip-leading-spaces-and-other-formatting-in-a-poem/407991 "2026-07-20T00:06:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)\
**Post date:** [2026年七月20日 00:35 UTC](https://meta.discourse.org/t/is-there-a-simple-way-to-not-strip-leading-spaces-and-other-formatting-in-a-poem/407991/2 "2026-07-20T00:35:31Z")

</div>

hi @pinetree1111 👋 欢迎

我不确定你是否认为这“简单”，但我觉得挺简单的，因为我偶尔在帖子里就用过，哈哈。

你可以用 `&nbsp;` 来表示空格：  
像这样

hello world  
&nbsp;this is a line with a leading space  
&nbsp;&nbsp;this is a line with 2 leading spaces  
&nbsp;&nbsp;&nbsp;this is a line with 3 leading spaces

代码：

```html
hello world
&nbsp;this is a line with a leading space
&nbsp;&nbsp;this is a line with 2 leading spaces
&nbsp;&nbsp;&nbsp; this is a line with 3 leading spaces

```

你也可以在它们之间加空格

hello world  
&nbsp; this is a line with 2 leading spaces  
&nbsp; &nbsp; this is a line with 4 leading spaces  
&nbsp; &nbsp; &nbsp; this is a line with 6 leading spaces

```plaintext
hello world
&nbsp; this is a line with 2 leading spaces
&nbsp; &nbsp; this is a line with 4 leading spaces
&nbsp; &nbsp; &nbsp; this is a line with 6 leading spaces

```

---

_[View the full topic](https://meta.discourse.org/t/is-there-a-simple-way-to-not-strip-leading-spaces-and-other-formatting-in-a-poem/407991)._
