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.

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.

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.

Aqui está o bug do Nokogiri aberto em seu nome conforme sua solicitação:

Você poderia me retornar com a saída de nokogiri -v, já que é isso que os desenvolvedores lá precisam.

Sinto-me como um servidor SMTP humano retransmitindo mensagens entre dois servidores que definitivamente não estão conversando entre si

:stuck_out_tongue_winking_eye: :crazy_face:

Na minha opinião, isso funciona no navegador devido a uma peculiaridade do próprio, e não a uma funcionalidade do HTML. O elemento strike não foi concebido para abranger divs e parágrafos.

Entendido. :innocent: E se o grupo Nokigiri implementar essa solicitação de recurso, isso eventualmente chegará ao Discourse. Então, posso ter a saída de:

nokogiri -v

por favor, pois preciso adicioná-la à descrição do bug, conforme solicitado por você e pelo Nokigiri, porque, do ponto de vista do usuário final, isso agora parece uma troca enganosa no Discourse:

(Por favor, observe a prévia e a saída final)

:sob:

Não apoio a alteração do Nokogiri. Se for necessário devido a múltiplas reclamações de clientes, podemos sanitizar esses elementos para que a prévia corresponda ou abrir bugs no Chrome e no Firefox.

:thinking:

Também é aceitável sanitizar a entrada de pré-visualização:

  • pelo menos é consistente do ponto de vista da interface do usuário.
  • Não é o que eu quero, mas é algo com que terei que conviver…

:grin: :innocent:

Basta estúpida interação com o usuário final por hoje: vou deixá-lo voltar para coisas mais importantes, como desenvolvimento real:wink:

@sam Como discutido offline, foi aberto um problema no nokogiri, que nos informou que, na verdade, é o CRuby que está usando o libxml2.

Portanto, um novo problema foi aberto no libxml2 para que, eventualmente, seja incorporado pelo nokogiri, depois pelo Discourse, e assim @alexs @codinghorror @mattman @Mittineague @riking possam ficar todos mais felizes com o riscado funcionando em várias linhas

Peço desculpas a todos por ser tão pedante com isso, mas:

Pessoas fáceis se adaptam ao seu ambiente, enquanto pessoas difíceis insistem que o ambiente se adapte a elas. Portanto, todo o progresso humano, desde a domesticação do fogo, a roda, as pirâmides, a penicilina, … até forçar elétrons a atravessar um túnel quântico para nos proporcionar armazenamento SSD pode ser atribuído a pessoas difíceis!

:grin: :wink: