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 Me gusta

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 Me gusta

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 Me gusta

Still an issue apparently :slight_smile:

3 Me gusta

Disculpas por reabrir este tema, pero pensé que podría aprovechar este hilo (en lugar de iniciar uno nuevo…)

Estoy seguro de que esto es bien sabido, pero con el enlace interno de onebox, si se expande se ve bien, pero por defecto, la vista no tiene formato.

Antes de expandir…

Cuando lo expandes se ve bien.

A menos que el OP cite texto, ¿no debería la vista previa mantener el formato, en lugar de intentar meter la mayor cantidad de texto posible en la caja?

¿O me estoy perdiendo algo y todo esto es intencional?

Correcto, no hay formato antes de la expansión, porque de lo contrario no podrías meter mucho texto ahí.

2 Me gusta

Ya veo, me imagino que ha sido así por un tiempo.

En mi humilde opinión, desde una perspectiva de UI, ¿no sería más “limpio” ver en qué publicación estoy entrando, en lugar de la versión apretada?

Si el OP de la publicación quiere resaltar texto específico, puede citarlo y se ve genial.

Siento que si están enlazando la publicación, pueden querer que hagamos clic en la publicación, o al menos que la expandamos y obtengamos algo de contexto.

Desde un juego de números puro, me imagino que más personas harían clic o expandirían una publicación con formato adecuado. Simplemente es más fácil de ver.

No olvidemos que la mayoría de los usuarios de Discourse no son codificadores ni programadores. Ver texto amontonado en una caja así no es algo a lo que estén acostumbrados a ver.

vs

… de nuevo, solo una opinión.

1 me gusta