Inconsistent internal onebox spacing

When two internal links are added to a topic the spacing between them is inconsistent. If no blank line is between the links the spacing is significantly greater than if a blank line is provided.

https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446
https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881
https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446

https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881

cc @awesomerobot

7 إعجابات

Oddly enough, when there’s no line between the two we add a <br> to the markup and when there is a line between the two we don’t.

4 إعجابات

Hmm, what do you recommend to fix?

Ah, I understand why this happens now (bear with me here)…

If I type:

word
word

…I intentionally put a single carriage return there, so it correctly renders as:

<p>
    word
    <br>
    word
</p>

When I type:

word

word

…this is two returns, so the markup is correctly output as two paragraphs:

<p>
    word
</p>
<p>
    word
</p>

But with oneboxes, we’re treating them as they’re input (two strings with a single carriage return) and not as they’re output (two separate HTML elements)…

For example, when I type:

https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446
https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881

…the output is:

<aside>
</aside>
<br>
<aside>
</aside>

This is technically correct for the input. I entered two lines with a carriage return between them… but I was required to put that carriage return there for the oneboxes to exist. We shouldn’t count that carriage return because it’s a prerequisite to generate oneboxes. I’m not doing it for the purpose of creating a new line of text (so there shouldn’t be a <br> there).

When I type:

https://meta.discourse.org/t/discourse-2-0-0-beta4-release-notes/82446

https://meta.discourse.org/t/discourse-2-0-0-beta5-release-notes/83881

…the output is:

<aside>
</aside>
<aside>
</aside>

This would be correct if they were two paragraphs, which is how the text is input, but not how it’s output. We should add a <br> here, because I’m adding a space that doesn’t need to be there (intentionally dividing the content).

10 إعجابات

Still an issue apparently :slight_smile:

3 إعجابات

أعتذر عن إثارة هذا الموضوع مرة أخرى ولكن اعتقدت أنه يمكنني الاستفادة من هذا الموضوع (بدلاً من بدء موضوع جديد…)

أنا متأكد من أن هذا معروف جيدًا ولكن مع الرابط الداخلي onebox، إذا تم توسيعه يبدو جيدًا - ولكن بشكل افتراضي، لا يحتوي العرض على أي تنسيق.

قبل التوسيع…

عندما تقوم بتوسيعه يبدو جيدًا.

ما لم يقتبس المؤلف النص، ألا ينبغي للمعاينة أن تحتفظ بالتنسيق - بدلاً من محاولة احتواء أكبر قدر ممكن من النص في المربع؟

أم أنني أفتقد شيئًا وكل هذا عن قصد؟

صحيح، لا يوجد تنسيق قبل التوسيع، لأنه بخلاف ذلك لا يمكنك وضع الكثير من النص هناك.

إعجابَين (2)

أرى، أتخيل أن الأمر كان كذلك لفترة طويلة.

في رأيي المتواضع، من منظور واجهة المستخدم، ألن يكون من “الأنظف” رؤية المنشور الذي أدخل إليه، بدلاً من النسخة المكدسة؟

إذا أراد صاحب المنشور الأصلي إبراز نص معين، يمكنه الاقتباس ويبدو الأمر رائعًا.

أشعر أنه إذا كانوا يربطون المنشور، فقد يرغبون في أن ننقر على المنشور، أو على الأقل نتوسع ونحصل على بعض السياق.

من منظور الأرقام البحتة، أتخيل أن المزيد من الأشخاص سينقرون أو يوسعون منشورًا بتنسيق مناسب. إنه أسهل في النظر إليه.

دعونا لا ننسى أن غالبية مستخدمي ديسكورس ليسوا مبرمجين أو مطورين. رؤية النص مكدسًا في مربع كهذا ليس شيئًا اعتادوا على رؤيته.

مقابل

.. مرة أخرى، مجرد رأي.

إعجاب واحد (1)