细节标签内的Spoiler不切换

I’m not 100% sure, but I think the following steps will reproduce the issue:

  1. Start writing a new post
  2. Add some text with [spoiler] tags around it.
  3. Unblur the text in the post preview. Note that you can reblur and unblur it as much as you want.
  4. Add some more text underneath the spoilered text.
  5. If you left the text in a blurred state, but you unblur it once. But after that (or right away if it was already unblurred) you cannot reblur the text again.

This can also happen in actual posts, not just in post previews. I’m not sure the exact steps to reproduce there (since you can’t type more between unblurring and reblurring), but as least in the one situation I saw the issue for, the blurred text was within details tags. I have no idea if that’s relevant though.


The following is for testing, but may or may not be helpful.

Some spoiler text

Some text after spoiler text.

Summary

Some more spoiler text

Some more text after spoiler text.

Some more text after spoiler text and details tag.

1 个赞

我注意到当 \u003cdetails\u003e 标签内包含剧透时,无法将其关闭。

这个 spoiler 可以打开和关闭(按预期工作)。

但是,这个不行:

Click to open 'details'

这个 spoiler 只能打开一次(无法关闭)。

我认为问题在于,在第二种情况下,isInteractive 函数返回 true,因为 details 被包含在 INTERACTIVE_SELECTOR 中。

移除它应该就足够了,但我不太确定会有什么副作用(也许 @CvX 知道)。

编辑:我看到这个更改的动机是想 点击时停止 GIF。在我们的社区中,我们大量使用剧透和 details,因此使模糊行为更加一致会很有用。

2 个赞

说明

当折叠内容被放入一个详细信息文件夹中时,可以通过像平常一样点击来取消模糊,但再次点击则无效,并且无法重新模糊。关闭并重新打开详细信息文件夹也无效。我在 Hopscotch 论坛上对此的说明解释得更好。

演示

请随意使用此详细信息文件夹作为示例。我的确切过程在 Hopscotch 论坛主题中有所解释。

详细信息文件夹

示例文本

如何复现

  1. 创建一个带有详细信息文件夹的帖子
  2. 将折叠内容放入其中
  3. 打开文件夹并取消文本模糊
  4. 文本在不刷新页面的情况下无法重新模糊
2 个赞

感谢您提供重现步骤。这是一个小麻烦(尤其是因为它包含在可折叠块内,我们可以通过折叠详细信息来隐藏内容),但修复它还是受欢迎的。
如果有人想尝试修复它,我会在主题中添加一个 #pr-welcome。

插件仓库在这里:GitHub - discourse/discourse-spoiler-alert: A plugin for discourse to hide spoilers behind the spoiler-alert jQuery plugin

但我感觉这更多是 Hide Details 功能的问题。

Hide Details 中的内容并不总是按预期显示(并进行交互?)。例如,热链接的图片、链接、视频等将不会显示。它只会显示链接:

摘要

https://cdn.discordapp.com/attachments/914531040297635861/1107226488534740992/1920x1080.png

https://www.youtube.com/watch?v=ipuqLy87-3A

Apex Legends pro sweet hits Predator rank with no kills to “prove how bad” Ranked is - Dexerto

3 个赞

谢谢!

1 个赞