It takes too many newlines to create a line break after a card image

User avatar
spacemonaut
Bauble reclaimer
Posts: 1387
Joined: 4 years ago
Answers: 10
Pronoun: she / her
Location: Scotland

Post by spacemonaut » 2 years ago

I'm borrowing @Neige's street fighter cards for this bug report since it's occuring in his street fighter boss thread. I'm going to demonstrate the problem, you may want to quote this post and inspect its bbcode to see what I'm going on about here.



Here's a ccimg tag with zero line breaks before the text.




One line break before the text... but this text is still on the same line as the image for some reason.





Two line breaks before the text. It's still on the same line. Why??






Three line breaks before the text. Now there's an actual new line as you read this.







For good measure, here's one with four line breaks before the text. After the third, the line breaks start behaving like normal.



It shouldn't require putting three whole linebreaks in the editor to get just one linebreak in the view. It should require only one linebreak in the editor to get one in the view.

It's not even some weird layout issue like the image is using float: left; or something like that — the bbcode parser itself is eating up the first two line breaks and completely ignoring them until I put three of them together and then it starts giving me <br> elements.

In this screenshot of my DOM inspector, note the total lack of <br> elements after the div in the "two new lines" example, and the highlighted singular <br> inserted in the "three line breaks" example.
2022-03-03_20-46-52_firefox.png

User avatar
Feyd_Ruin
Elder Vampire
Posts: 5478
Joined: 5 years ago
Answers: 3
Pronoun: he / him
Contact:

Post by Feyd_Ruin » 2 years ago

Fixed.
It saw that what we were creating was a block element, so it assumed we didn't actually need the br, since it pushes to a "new line" anyways. But since that block element was actually displaying as in-line block, that was a bad assumption. Swapped to a <span> and it knows better now.
Old posts may need to be edited and resaved.
To the beaten, the broken, or the damned; the lost, and the wayward: wherever I may be, you will have a home.

User avatar
spacemonaut
Bauble reclaimer
Posts: 1387
Joined: 4 years ago
Answers: 10
Pronoun: she / her
Location: Scotland

Post by spacemonaut » 2 years ago

Thank you very much!

Here's the same content as the post within a spoiler block. It works perfectly!
SPOILER
Show
Hide
Here's a ccimg tag with zero line breaks before the text.




One line break before the text... but this text is still on the same line as the image for some reason.





Two line breaks before the text. It's still on the same line. Why??






Three line breaks before the text. Now there's an actual new line as you read this.







For good measure, here's one with four line breaks before the text. After the third, the line breaks start behaving like normal.

Post Reply Previous topicNext topic

Return to “Community Software Feedback and Bug Reports”