alexs
(Alex Sherwood)
2017 年6 月 20 日 12:43
1
I’m not sure whether this bug is specific to Discourse but when I try to strikethrough several lines of text & one of those lines is a quote, the quote’s text is not struck out.
The preview displays the quoted text as struck out -
but when posted, it renders like this -
Striking out each line instead like this -
does behave as I was expecting -
cpradio
(cpradio)
2017 年6 月 20 日 13:11
2
You should really try that example at https://markdown-it.discourse.org
As that is the site testing implementing the common mark spec into Discourse.
sam
(Sam Saffron)
2017 年6 月 20 日 13:19
3
Works fine in Markdown.it
alexs
(Alex Sherwood)
2017 年6 月 20 日 13:41
4
I’m still having the same issue in Markdown.it, in your example you haven’t got struck out text before the quote but in mine, I have -
looks like
From this topic -
https://markdown-it.discourse.org/t/testing-multi-line-strikethrough-with-quotes/90
sam
(Sam Saffron)
2017 年6 月 20 日 13:43
5
Looks like nokogiri may be messing stuff up, I will investigate.
Let’s see
Some text
a quote
raw
<s>Some text
> a quote
</s>
This still happens.
sam
(Sam Saffron)
2017 年7 月 20 日 11:26
7
Strike is an inline, not a block level element, I may just add a rule to balance inline tags
mattman
(Matt Maier)
2018 年7 月 28 日 01:16
8
So this is still a thing. The preview is different from the final product.
Simple workaround, use strikethrough as a line not block element.
Rather than expecting this to work
<s>
hey
> there
</s>
Strikethrough each line instead
<s>hey</s>
> <s>there</s>
hey
there
mattman
(Matt Maier)
2018 年7 月 28 日 01:59
10
Thanks, but I wasn’t asking for a work around. I was pointing out that this bug still exists. It’s weird that the preview gets it right but the actual render doesn’t.
It’s unlikely we will be “fixing” this bug anytime soon, so plan accordingly
I’m not so sure this is a bug. Phrasing content can’t be expected to work well with Flow content that is not itself Phrasing content. eg. <div> or <p> tags.
https://html.spec.whatwg.org/multipage/dom.html#flow-content
https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
What would be required is to parse the single opening and closing <s> tags to multiple tags within the parent Flow content elements.
IMHO, that is most likely a bit much for something that is edge case and has an existing workaround.
riking
(Kane York)
2018 年7 月 28 日 05:06
13
What’s happening is the browser is applying an age-old fix by copying the <s> onto each paragraph until the close tag. The server uses Nokogiri which does not Reconstruct the active formatting elements but instead inserts a close tag for the strikethrough at the end of paragraph, as you would for any non-formatting mis-nested tag.
It’s officially specified as applying to a, b, big, code, em, font, i, nobr, s, small, strike, strong, tt, and u.
See https://html.spec.whatwg.org/multipage/parsing.html#misnested-tags:-b-i-/b-/i:reconstruct-the-active-formatting-elements
sam
(Sam Saffron)
2018 年7 月 28 日 06:25
14
I am not against somebody submitting a patch nokogiri that works around this issue, or gives it a mode where it is able to handle it and we use it.
But I am moving this to feature … cause technically you provided bad HTML, if anyone is passionate about this raise it on the CommonMark site or Nokogiri bug tracker.
Fabby
2020 年1 月 28 日 21:28
15
已按您的要求为您提交了关于 Nokogiri 的 Bug 报告 as per your request :
opened 09:25PM - 28 Jan 20 UTC
closed 08:27PM - 29 Jan 20 UTC
topic/HTML5
**Describe the bug**
As per https://meta.discourse.org/t/multi-line-strikethrou… gh-not-covering-quotes/64808/12 raising a bug here as this is still not fixed after 2 years *over there* and I can't seem to find this bug here on this repository's issue list. **¯\\_(ツ)_/¯**
As Discourse is using Nokogiri, the preview and the eventual post over there are not matching up as Nokogiri does not Reconstruct the active formatting elements of the `<s>Strikethrough</s>` tags
**To Reproduce**
https://meta.discourse.org/t/multi-line-strikethrough-not-covering-quotes/64808
**Expected behavior**
for:
```
<s>Strikethrough begin
Strikethrough end</s>
```
to actually display strikethrough over 2 lines instead of just the first one.
**Environment**
Please paste the output from `nokogiri -v` here, escaped by triple-backtick.
I'm an and-user bringing this to your attention. Please follow up with https://meta.discourse.org/u/sam
**Additional context**
<s>It's just bloody annoying</s> Cosmetic, User Interface only. **0:-)**
能否请您回复 nokogiri -v 的输出结果?那边的开发人员需要这个信息。
我感觉自己像个人工 SMTP 服务器,在两台显然彼此无法通信 的服务器之间转发消息
sam
(Sam Saffron)
2020 年1 月 28 日 22:18
16
在我看来,它在浏览器中生效是由于浏览器的一个 quirks,而非 HTML 特性。<strike> 标签本就不应用于跨越 <div> 和段落。
Fabby
2020 年1 月 28 日 22:24
17
明白了。 如果 Nokigiri 团队实现了这个功能请求,最终也会影响到 Discourse。所以能否请您提供以下输出?
nokogiri -v
我需要将其添加到错误描述中,以响应您和 Nokigiri 的要求。因为从最终用户的角度来看,Discourse 现在看起来像是一种“诱饵与调包”:
(请注意预览与最终输出的差异)
sam
(Sam Saffron)
2020 年1 月 28 日 22:26
18
我不支持更改 Nokogiri。如果因多位客户投诉而必须更改,我们可以对这些元素进行清理,使预览保持一致,或者向 Chrome 和 Firefox 提交缺陷报告。
Fabby
2020 年1 月 28 日 22:31
19
对预览输入进行清理也是可以接受的:
至少从用户界面的角度来看,这样更一致。
这并不是我想要的 ,但我不得不接受……
今天的愚蠢 用户互动到此为止:我要让你们回去忙更重要的事情了,比如真正的开发 ……
Fabby
2020 年1 月 31 日 03:40
20
@sam 根据线下讨论,已在 nokogiri 提交了一个问题,对方告知我们实际上是 CRuby 在使用 libxml2。
因此,我们又在 libxml2 提交了一个新问题,以便最终能被 nokogiri 集成,进而让 discourse 以及 @alexs @codinghorror @mattman @Mittineague @riking 都能更开心,因为 多行删除线功能将得以实现 。
对此事如此较真,我向大家表示歉意,但:
容易适应环境的人随遇而安,而难搞的人则坚持让环境适应他们。因此,从驯化火种、发明车轮、建造金字塔、发现青霉素……一直到迫使电子穿越量子隧穿以实现 SSD 存储的所有人类进步,都可以归功于那些难搞的人!