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

**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:** 7
**Page:** 1

<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年十一月16日 15:18 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604/1 "2025-11-16T15:18:35Z")

</div>

我正在寻找一个解决方案

> [@Discourse Show Fullname in Mentions](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/36):
>
> We leverage group handles as a means to operate transparently while simultaneously ensuring that only pertinent recipients are notified. Currently, we must educate users on selecting the correct handles for addressing individuals, as altered handles are displayed during copy and paste operations. Could you think about a way how the right mention could be transferred by copy & paste, especially in combination with [the new composer](https://meta.discourse.org/t/introducing-our-new-composer-making-writing-on-discourse-easier-than-ever/369779)?

有没有办法让插件/组件决定通过复制粘贴粘贴了什么代码？

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [2025年十一月16日 23:30 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604/2 "2025-11-16T23:30:16Z")

</div>

您能详细说明一下吗？我认为我还没有完全理解。据我所知，全名提及在复制和粘贴时显示，而用户名提及在帖子中是正常的？或者复制和粘贴全名提及不会转移过来？

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2025年十二月3日 20:15 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604/3 "2025-12-03T20:15:06Z")

</div>

你好，托马斯！👋 你能分享一个例子来说明你的意思吗？如果你愿意，可以用德语写，你的帖子将为我们自动翻译。

---

<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]`？

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2025年十二月5日 21:10 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604/5 "2025-12-05T21:10:36Z")

</div>

您是在模仿 Discourse 的方式，使用选中帖子中某些文本时弹出的那个小窗口吗？我相信那样可以按预期工作，但我最近没有测试过。

> [@thoka](#):
>
> 我们使用 [Discourse Show Fullname in Mentions](https://meta.discourse.org/t/discourse-show-fullname-in-mentions/216319/)。

编辑：哦，等等。仔细阅读后才发现。这不是一个官方的主题组件，所以要获得该组件的支持，您应该在那个主题中回复。我认为您描述的可能是一个错误。

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2025年十二月5日 21:46 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604/6 "2025-12-05T21:46:23Z")

</div>

鉴于这是一场关于非官方主题组件的讨论，让我们保持在这一主题上。

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2025年十二月5日 21:46 UTC](https://meta.discourse.org/t/how-to-make-copy-paste-of-full-mentions-possible/388604/7 "2025-12-05T21:46:27Z")

</div>


