# 引用剧透文本，不会包含剧透标签

**URL:** https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145
**Category:** Bug
**Tags:** fixed
**Created:** [2020年十一月14日 18:17 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145 "2020-11-14T18:17:12Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2020年十一月14日 18:17 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/1 "2020-11-14T18:17:12Z")

</div>

目前存在一个问题：高亮包含 spoiler 文本的文本时，引用中并未正确添加 spoiler 标签。这之前确实可以正常工作，但我不确定是从何时开始失效的。

例如，如果您高亮整个句子，spoiler 部分 在引用中并不会被 spoiler 标签包裹。

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2020年十一月14日 18:17 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/2 "2020-11-14T18:17:39Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/1/a/1acda55a629748b8b20d7bd384017fdef1b93147.png)

> [@seanblue](#):
>
> 例如，如果你高亮显示整个句子，引用中的剧透部分并不会被剧透标签遮挡。

---

<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: [2020年十一月14日 19:09 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/3 "2020-11-14T19:09:08Z")

</div>

据我所知，“选中文本并引用”功能会尽力利用我们的 HTML 转 Markdown 转换库来保留格式。

如果您使用“引用整篇帖子”（编辑器中的第一个按钮），系统会向服务器请求原始 Markdown 内容，这样引用内容就会包含所有原始格式。

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2020年十一月14日 20:35 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/4 "2020-11-14T20:35:05Z")

</div>

支持引用剧透文本的功能已于 [2018 年 8 月](https://meta.discourse.org/t/cannot-quote-spoiler-text/92864/19?u=seanblue) 恢复，并在今年 6 月得到了改进（即使是偶然的），相关说明可参考 [此处](https://meta.discourse.org/t/revealed-spoiler-text-is-no-longer-styled-differently/155790/4?u=seanblue)。因此，尽管我理解可以将整篇帖子作为引用作为一种变通方法，但这确实是一项曾经可用而现在失效的功能。

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2020年十一月27日 22:45 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/5 "2020-11-27T22:45:46Z")

</div>

这有修复的可能吗？

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2020年十一月27日 23:59 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/6 "2020-11-27T23:59:13Z")

</div>

可能最终会支持，目前您可以在引号中进行必要的编辑，因此存在一种变通方法。

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2020年十一月28日 02:01 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/7 "2020-11-28T02:01:40Z")

</div>

好的。只是想确认一下，谢谢。

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2021年三月17日 02:11 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/8 "2021-03-17T02:11:49Z")

</div>

我刚刚意识到这仍然有问题。😢

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2024年五月28日 16:10 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/11 "2024-05-28T16:10:00Z")

</div>

感谢 @seanblue 的报告和您的（极大的）耐心 😅

将通过 👇 修复

> <https://github.com/discourse/discourse/pull/27232>
>
> Was "removing" (rather not re-applying) the \`\[spoiler\]\` BBCode because we were t…esting the \*\*whole\*\* class of the \`span\`/\`div\` was \`spoiled\` but we added another class and thus broke this functionnality.
> 
> In order to fix this issue, the test to determine whether a \`span\`/\`div\` is a spoiler, now uses a regular expression to check whether the \`class\` \*\*contains\*\* the word \`spoiled\`.
> 
> Also slightly improved the \`toMarkdown\` of the block version of a spoiler to add newlines after the opening \`\[spoiler\]\` tag and before the closing \`\[/spoiler\]\` tag.
> 
> Reference - https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145

（_抄送 @lindsey 以便知晓_）

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2024年六月1日 07:00 UTC](https://meta.discourse.org/t/quoting-spoiler-text-doesnt-include-spoiler-tags-in-the-quote/170145/15 "2024-06-01T07:00:22Z")

</div>

此主题已在 3 天后自动关闭。不再允许回复。
