Multi-Line Strikethrough Not Covering Quotes

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 -

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.

Works fine in Markdown.it

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

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.

Strike is an inline, not a block level element, I may just add a rule to balance inline tags

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

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 :wink:

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.

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.

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

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.

요청하신 대로 대신 등록한 Nokogiri 버그입니다: 요청하신 대로:

거기 개발자들이 필요로 하는 nokogiri -v의 출력을 알려주실 수 있을까요?

서로 결코 대화하지 않는 두 서버 사이에 메시지를 전달하는 인간 SMTP 서버 같은 기분이 듭니다.

:stuck_out_tongue_winking_eye: :crazy_face:

제 생각에는 HTML 기능이 아니라 브라우저의 특수한 동작(quirk) 때문에 브라우저에서 동작하는 것입니다. strike 태그는 div나 p를 가로지르는 데 사용되지 않습니다.

알겠습니다. :innocent: 그리고 Nokigiri 그룹이 이 기능 요청을 구현하게 된다면, 이 기능이 결국 Discourse로 전파될 것입니다. 따라서 다음을 요청할 수 있을까요:

nokogiri -v 

출력 결과를 알려주세요. 귀하와 Nokigiri의 요청에 따라 버그 설명에 이 내용을 추가해야 하는데, 최종 사용자 관점에서 볼 때 이는 Discourse에서 마치 속임수(bait-and-switch)처럼 보이기 때문입니다:

(미리보기와 최종 출력을 참고해 주세요)

:sob:

nokogiri를 변경하는 것은 지지하지 않습니다. 여러 고객 불만으로 인해 반드시 변경해야 한다면, 미리보기가 일치하도록 해당 요소를 정제하거나 Chrome과 Firefox에 버그를 신고할 수 있습니다.

:thinking:

미리보기 입력값을 소독(Sanitize)하는 것도 허용할 수 있습니다:

  • 적어도 UI 관점에서는 일관성이 있습니다.
  • 제가 원하는 방식은 아니지만, 그렇게 살아가야 할 부분이긴 하죠…*

:grin: :innocent:

오늘은 바보 같은 사용자 인터랙션은 이 정도면 충분합니다. 더 중요한 일, 예를 들어 실제 개발 같은 것에 집중하시죠… :wink:

@sam 오프라인에서 논의한 대로, nokogiri에 이슈를 열었으며, 해당 프로젝트 측에서는 실제로 libxml2를 사용하는 쪽이 CRuby라고 알려주었습니다.

따라서 결국 nokogiri를 통해, 그리고 discourse를 통해 이 문제가 해결되어 @alexs @codinghorror @mattman @Mittineague @riking 모두 더 만족스러운 사람이 될 수 있도록 libxml2 측에도 새로운 이슈를 열었습니다. 여러 줄에 걸쳐 취소선이 적용되도록 하기 위해

이 문제에 대해 이렇게 집요하게 따지는 것에 대해 모두에게 사과드립니다. 하지만:

쉬운 사람은 환경에 자신을 적응시키는 반면, 어려운 사람은 환경이 자신에게 적응하도록 강요합니다. 따라서 불길 수복, 바퀴, 피라미드, 페니실린… 그리고 전자를 양자 터널을 통해 강제로 통과시켜 SSD 저장소를 만들어준 것까지, 모든 인류의 진보는 어려운 사람들 덕분입니다!

:grin: :wink: