# 如何才能复制粘贴完整的提及内容？

**URL:** <https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604>\
**Category:** Support\
**Created:** [2025年十一月16日 15:18 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604 "2025-11-16T15:18:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)\
**Post date:** [2025年十二月5日 20:14 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604/4 "2025-12-05T20:14:24Z")

</div>

我们使用 [https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/。因此，渲染后的帖子中的提及内容无法复制并粘贴到新帖子中。](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/%E3%80%82%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%B8%B2%E6%9F%93%E5%90%8E%E7%9A%84%E5%B8%96%E5%AD%90%E4%B8%AD%E7%9A%84%E6%8F%90%E5%8F%8A%E5%86%85%E5%AE%B9%E6%97%A0%E6%B3%95%E5%A4%8D%E5%88%B6%E5%B9%B6%E7%B2%98%E8%B4%B4%E5%88%B0%E6%96%B0%E5%B8%96%E5%AD%90%E4%B8%AD%E3%80%82)  
替换后的用户名存储在渲染内容中的数据属性中：

```plaintext
<a class="mention mention-fullname discourse-show-name-mentions" data-full-name="Thomas Kalka" href="/u/toka" data-original-mention="@toka">@Thomas Kalka</a>

```

我希望找到一种方法，确保在创建帖子时从渲染文本（已处理内容）复制时捕获适当的提及，在本例中为 `@toka`。

有哪些选项可以自定义从 HTML 构建 Markdown 内容的算法，特别是针对这种情况，以便为 `a.mention-fullname` 插入 `a[data-original-mention]`？

---

_[View the full topic](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604)._
