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 Mi Piace

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 Mi Piace

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 Mi Piace

Still an issue apparently :slight_smile:

3 Mi Piace

Mi scuso per aver ripreso questo argomento, ma ho pensato di poterlo sfruttare (invece di crearne uno nuovo…)

Sono sicuro che sia ben noto, ma con il link interno onebox, se viene espanso ha un bell’aspetto, ma per impostazione predefinita, la visualizzazione non ha formattazione.

Prima di espandere…

Quando lo espandi ha un bell’aspetto.

A meno che l’OP non citi del testo, l’anteprima non dovrebbe mantenere la formattazione, invece di cercare di inserire più testo possibile nella casella?

O mi sfugge qualcosa e tutto questo è voluto?

Corretto, non c’è formattazione prima dell’espansione, perché altrimenti non si potrebbe inserire molto testo lì.

2 Mi Piace

Ah capisco, immagino sia così da un po’.

IMHO, da una prospettiva UI, non sarebbe più “pulito” vedere a quale post sto accedendo, invece della versione compressa.

Se l’OP del post vuole evidenziare del testo specifico, può citarlo e fa una bella figura.

Penso che se stanno linkando il post, potrebbero volerci far cliccare sul post, o almeno espandere e ottenere un po’ di contesto.

Da un puro gioco di numeri, immagino che più persone cliccherebbero o espanderebbero un post con una formattazione adeguata. È semplicemente più facile da guardare.

Non dimentichiamo che la maggior parte degli utenti di Discourse non sono programmatori o sviluppatori. Vedere testo ammassato in una casella come quella non è qualcosa a cui sono abituati.

vs

…di nuovo, solo un’opinione.

1 Mi Piace