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 日午後 1: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 日午後 1:19
3
Works fine in Markdown.it
alexs
(Alex Sherwood)
2017 年 6 月 20 日午後 1: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 日午後 1: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 日午前 1: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 日午前 1: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 日午前 5: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 日午前 6: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 日午後 9:28
15
ご依頼通り、Nokogiri のバグ報告を提出しました リクエストに応じて :
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 の出力ですので、その結果をお知らせください。
まるで、明らかに互いに通信していない 2 つのサーバー の間でメッセージを中継する人間の SMTP サーバーのようです
sam
(Sam Saffron)
2020 年 1 月 28 日午後 10:18
16
私の見解では、これは HTML の機能ではなくブラウザのバグによりブラウザ内で動作しているものです。strike タグは div や段落にまたがることを意図していません。
Fabby
2020 年 1 月 28 日午後 10:24
17
了解しました。 Nokigiri グループがこの機能リクエストを実装すれば、最終的には Discourse にも反映されるはずです。そこで、以下の nokogiri -v の出力をいただけますでしょうか?ご要望および Nokigiri の要望通り、バグの説明に追加する必要があります。エンドユーザーの観点から見ると、Discourse においてこれは「手口を隠す」ように見えるからです:
(プレビューと最終出力にご注意ください)
sam
(Sam Saffron)
2020 年 1 月 28 日午後 10:26
18
nokogiri の変更には賛成しません。複数の顧客からの苦情により変更が必要であれば、プレビューと一致するようにこれらの要素をサニタイズするか、Chrome と Firefox にバグ報告を出しましょう。
Fabby
2020 年 1 月 28 日午後 10:31
19
プレビュー入力のサニタイズも許容されます:
少なくとも UI の観点から一貫性があります。
私が望む ものではありませんが、我慢するしかないでしょう…
今日のためのバカな エンドユーザーとのやり取りはこれで十分です。実際の開発 など、より重要なことに戻っていただきましょう…
Fabby
2020 年 1 月 31 日午前 3:40
20
@sam オフラインでの議論に基づき、nokogiri に issue を作成しました。同プロジェクトからは、実際には CRuby が libxml2 を使用していると回答がありました。
そのため、最終的に nokogiri に取り込まれ、Discourse が対応できるようになることを期待して、libxml2 側にも新たな issue を作成 しました。これにより、@alexs @codinghorror @mattman @Mittineague @riking の皆様が、複数行にわたる取り消し線 が機能するようになることで、より幸せになれることを願っています。
この件については非常に細かくなってしまい、皆様にお詫び申し上げますが:
「楽観的な人々は環境に適応するが、困難な人々は環境が自分たちに適応することを求める。したがって、火の制御、車輪、ピラミッド、ペニシリン、……から、電子を量子トンネルに通して SSD ストレージを実現するに至るまで、すべての人類の進歩は、困難な人々によるものである!」