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 -

1 « J'aime »

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.

3 « J'aime »

Works fine in Markdown.it

3 « J'aime »

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

4 « J'aime »

Looks like nokogiri may be messing stuff up, I will investigate.

7 « J'aime »

Let’s see

Some text

a quote

raw

<s>Some text

> a quote

</s>

This still happens.

1 « J'aime »

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

2 « J'aime »

So this is still a thing. The preview is different from the final product.

1 « J'aime »

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

1 « J'aime »

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.

2 « J'aime »

It’s unlikely we will be “fixing” this bug anytime soon, so plan accordingly :wink:

2 « J'aime »

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.

3 « J'aime »

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

5 « J'aime »

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.

6 « J'aime »

Voici le bug Nokogiri signalé en votre nom comme convenu:

Pourriez-vous revenir vers moi avec la sortie de nokogiri -v, car c’est ce dont les développeurs ont besoin.

J’ai l’impression d’être un serveur SMTP humain relayant des messages entre deux serveurs qui ne communiquent absolument pas entre eux

:stuck_out_tongue_winking_eye: :crazy_face:

1 « J'aime »

À mon avis, cela fonctionne dans le navigateur en raison d’un comportement imprévu du navigateur, et non d’une fonctionnalité HTML. La balise strike n’est pas conçue pour s’étendre sur des div et des paragraphes.

3 « J'aime »

Compris. :innocent: Et si l’équipe Nokogiri implémente cette demande de fonctionnalité, cela finira par se répercuter sur Discourse. Alors, pouvez-vous me fournir la sortie de :

nokogiri -v 

s’il vous plaît, car je dois l’ajouter à la description du bug, comme demandé par vous et par Nokigiri, car du point de vue d’un utilisateur final, cela ressemble désormais à un changement d’avis dans Discourse :

(Veuillez noter l’aperçu et la sortie finale)

:sob:

Je ne suis pas favorable à la modification de Nokogiri. Si nous devons le faire en raison de multiples réclamations de clients, nous pouvons assainir ces éléments afin que l’aperçu corresponde, ou ouvrir des bugs auprès de Chrome et Firefox.

:thinking:

La sanitisation de l’aperçu des entrées est également acceptable :

  • du moins, cela assure une cohérence du point de vue de l’interface utilisateur.
  • Ce n’est pas ce que je veux, mais c’est quelque chose avec quoi je vais devoir vivre…

:grin: :innocent:

Assez d’interaction bête avec l’utilisateur pour aujourd’hui : je vous laisse retourner à des choses plus importantes comme le vrai développement:wink:

@sam Comme convenu lors de notre discussion hors ligne, un problème a été signalé sur nokogiri, qui nous a indiqué que c’est en réalité CRuby qui utilise libxml2.

Par conséquent, un nouveau ticket a été ouvert sur libxml2 afin qu’il soit éventuellement intégré par nokogiri, puis Discourse, et que @alexs @codinghorror @mattman @Mittineague @riking puissent tous être plus heureux pour que le barré fonctionne sur plusieurs lignes.

Je m’excuse auprès de tous d’être aussi pointilleux à ce sujet, mais :

Les gens faciles s’adaptent à leur environnement, tandis que les gens difficiles insistent pour que leur environnement s’adapte à eux. Par conséquent, tout le progrès humain, depuis la maîtrise du feu, la roue, les pyramides, la pénicilline, … jusqu’au forçage des électrons à travers un tunnel quantique pour nous offrir le stockage SSD peut être attribué aux gens difficiles !

:grin: :wink:

6 « J'aime »