# 复制代码块时未包含前导空格

**URL:** <https://meta.discourse.org/t/copying-a-code-block-does-not-include-leading-spaces/414093>\
**Category:** Bug\
**Created:** [2026 年10 月 6 日 21:51 UTC](https://meta.discourse.org/t/copying-a-code-block-does-not-include-leading-spaces/414093 "2026-10-06T21:51:33Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [2026 年10 月 6 日 21:51 UTC](https://meta.discourse.org/t/copying-a-code-block-does-not-include-leading-spaces/414093/1 "2026-10-06T21:51:33Z")

</div>

使用复制按钮\[1\] 复制代码块时，不会包含任何前导空格。

测试用例：

```plaintext
        GPU0 GPU1 NIC0 NIC1 CPU Affinity NUMA Affinity GPU NUMA ID
GPU0 X NV12 NODE NODE 0-15 0 N/A
GPU1 NV12 X PHB PHB 0-15 0 N/A
NIC0 NODE PHB X PIX                             
NIC1 NODE PHB PIX X

```

实际复制的内容：

```plaintext
GPU0 GPU1 NIC0 NIC1 CPU Affinity NUMA Affinity GPU NUMA ID
GPU0 X NV12 NODE NODE 0-15 0 N/A
GPU1 NV12 X PHB PHB 0-15 0 N/A
NIC0 NODE PHB X PIX                             
NIC1 NODE PHB PIX X

```

在帖子和聊天中都会出现同样的问题。

Linux 上的 Chromium 浏览器。

* * *

1.

---

_[View the full topic](https://meta.discourse.org/t/copying-a-code-block-does-not-include-leading-spaces/414093)._
