Oneboxes 在引用块内无法工作?

大家好,

之前我为一些用户写过几篇“操作指南”。其中一篇特别介绍了如何在帖子中嵌入 Sketchfab 3D 模型。

我提供了一个示例主题,将文本块引用,使其看起来更像一个“主题”。在示例中,我只显示了 URL,并用反斜杠转义了它;而在其下方,我做了同样的操作,但没有转义 Sketchfab 链接,这样模型就会出现在块引用区域内。

今天偶然看到这个主题,我发现:现在即使转义 URL 中的正斜杠或用 HTML 实体替换它们,链接也不会再仅显示为文本(即不会自动变为超链接),而且嵌入的 Sketchfab 3D 内容也不再显示。

目前我唯一能想到的解决办法是不对这部分内容进行块引用,但这看起来有点难看。

由于我不常阅读自己写的“操作指南”,所以之前并未注意到这一变化,因此这个问题可能已经存在一段时间了。

大家有什么想法吗?是否有什么原因导致 Onebox 生成的内容无法出现在块引用中?

以下内容原本打算作为示例,但它在我们的托管版本中表现不同:

这里有个好看的东西:

Desert Bridge - 3D model by McFuzz [d75d53b] - Sketchfab

在上面这个例子中,似乎 Onebox 的部分功能已经生效,显示了模型的标题;但在我们托管的版本中,只显示了链接。

这里有个好看的东西:

……而在上面的例子中,我无法在块引用中显示模型。

1 个赞

Hey Rob, I work for Sketchfab (lowercase f ;-). This sounds more like a Discourse issue, but if there’s anything we can do to help, let me know!

3 个赞

Hi Bart,

Thank you, appreciated. It did used to work as I had wanted so I can only assume it has been via a change in Discourse at some point, there is probably a good reason behind it, but just in case there isn’t I thought I’d ask in the hope that I can revert to what I had :slight_smile:

My apologies regarding the “F”, I will correct on our site also!

2 个赞

Any ideas here @jomaxro?

1 个赞

We have the same issue with any onebox in a quote.

Adding an internal Discourse link gives us the “inline” onebox:
Oneboxes don't work inside quote blocks?
Twitter (or any other link) also doesn’t expand, we get “inline” too.
https://twitter.com/discourse/status/983464342799593478

It’s possible this broke as soon back when we added inline oneboxing, or a more recent regression, can’t say. Personally I’d call this a bug.

1 个赞

Hmm so all oneboxing is broken??

No, I don’t think so. I am unclear what you are saying Josh?

2 个赞

The issue arises when a link is inside a quote.
When the link is on its own, it gets oneboxed. When it’s inside a quote, it gets “inlined”.

https://twitter.com/triketora/status/986356346672082944

vs

> https://twitter.com/triketora/status/986356346672082944

vs

https://twitter.com/triketora/status/986356346672082944

3 个赞

Right, oneboxing within a blockquote was never supported and isn’t supposed to work.

Left out “in a quote”, fixed that. Thanks @zogstrip for clarifying.

3 个赞
If you absolutely positively need to, this workaround can work, no guarantees it will work forever though.
<blockquote>
If you absolutely positively need to, this workaround can work, no guarantees it will work forever though. 

https://twitter.com/triketora/status/986356346672082944

</blockquote>
3 个赞

Thanks everyone for looking at this and discussing it, truly appreciated.

It’s a shame it isn’t an intentional feature, as it has been very useful, not something worthy of consideration as a feature rather than a bug @codinghorror?

Thanks for the headsup about using the HTML markup @sam, I will give that a go for now and appreciate the warning that it may stop in the future.

Thanks again everyone, appreciate the support :slight_smile:

If the site had already been oneboxed in a topic it seems noisy to have a huge onebox every time the link is mentioned again. Having it show as a link rather than a onebox in a quote seems preferable.

2 个赞

That is a very good point, I was obviously only thinking of the specific usage/need I had, which was to be able to display a before/after view of a users post.

I suspect it would be of little use to anyone else, so perhaps requesting its behaviour could be configurable, at a post level, wouldnt really be worth it.

I guess a better approach for myself would be to create a couple of screenshots instead and edit those where necessary.

3 个赞