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 بشري يقوم بتحويل الرسائل بين خادمين لا يتحدثان بالتأكيد مع بعضهما البعض

؛P :crazy_face:

من وجهة نظري، يعمل هذا في المتصفح بسبب خلل في المتصفح وليس كخاصية في HTML، فالوسم strike غير مخصص لتمديد تأثيره عبر عناصر div والفقرات.

فهمت. :innocent: وإذا قام فريق Nokigiri بتنفيذ طلب الميزة هذا، فسيصل ذلك في النهاية إلى Discourse. لذا، هل يمكنني الحصول على:

nokogiri -v 

مخرجات من فضلك، حيث يجب أن أضيف هذا إلى وصف الخطأ كما طلبت أنت وفريق Nokigiri، لأنه من منظور المستخدم النهائي، يبدو هذا الآن وكأنه خدعة في Discourse:

(يرجى ملاحظة المعاينة والمخرجات النهائية)

:sob:

لا أدعم تغيير Nokogiri؛ وإذا اضطررنا إلى ذلك بسبب شكاوى متعددة من العملاء، فيمكننا تنقية هذه العناصر بحيث يتطابق المعاين، أو فتح أخطاء في Chrome وFirefox.

:thinking:

يُعد تنظيف مدخلات المعاينة مقبولًا أيضًا:

  • على الأقل، فهو متسق من منظور واجهة المستخدم.
  • ليس هذا ما أريده، لكنه شيء سأضطر للعيش معه…

:grin: :innocent:

كفاية تفاعل أحمق مع المستخدم النهائي ليومنا: سأترككم تعودون إلى أمور أكثر أهمية مثل التطوير الفعلي:wink:

@sam وفقًا للمناقشة غير المتصلة، تم فتح مشكلة في nokogiri، الذين أبلغونا بأن الأمر يعود فعليًا إلى CRuby الذي يستخدم libxml2.

لذلك، تم فتح مشكلة جديدة في libxml2 حتى يتم دمجها في النهاية بواسطة nokogiri، ثم discourse، وسيكون الجميع @alexs @codinghorror @mattman @Mittineague @riking أكثر سعادة لأن الشطب يعمل عبر سطور متعددة

أعتذر للجميع عن كوني متشددًا بشأن هذا الأمر، ولكن:

الناس السهلون يتكيفون مع بيئتهم، بينما الناس الصعبون يصرّون على أن تتكيف بيئتهم معهم. لذلك، يمكن إرجاع كل تقدم بشري، من ترويض النار، والعجلة، والأهرامات، والبنسلين، … وصولاً إلى دفع الإلكترونات عبر نفق كمي لتوفير تخزين SSD، إلى الناس الصعبين!

:grin: :wink: