r/ProgrammerHumor • • Oct 24 '26

Meme waitingForHtmlVulnerability

Post image
6.7k Upvotes

145 comments sorted by

View all comments

Show parent comment

10

u/chiya_coffee Oct 24 '26

Entities are for representing characters, like &amp; or &nbsp;. A line break in HTML is an element, not a character, which is why <br> is a tag.

25

u/arealuser100notfake Oct 24 '26

What a LLM way of tangentially responding with a lot of words while also not addressing the main point of the comment at all

8

u/Sock_Ninja Oct 24 '26

There wasn’t really a point given, just an opinion. The responder, LLM bot or otherwise, gave more justification than OP did.

Though I am curious to hear OP’s justification.

19

u/saschaleib Oct 24 '26

What does <br> that is different from inserting a line break? Something that is done pretty much everywhere else by inserting a newline character…

4

u/Sock_Ninja Oct 24 '26

That’s a fair argument.

4

u/rosuav Oct 24 '26

A line break in the HTML source is just whitespace and can be collapsed. A <br> element is going to remain as a line break in the output, regardless of the formatting of the source.

Whether it's correct to even HAVE a "line break in the output" concept is a separate question, but it can't be done with a \n character or any other whitespace.

2

u/Ilsor Oct 26 '26

<br> used to have an attribute called "clear". Entities can't have attributes.

As usual, the issue is a historical artifact that is now deprecated.

1

u/uuewy Oct 24 '26

flexbox

2

u/uuewy Oct 24 '26

wait actually I haven't done any frontend work in a while I'm dumb

2

u/saschaleib Oct 24 '26

<br> was already in the original HTML specs, but flexbox only came, like, last week or so ...

-6

u/chiya_coffee Oct 24 '26

english is not my native language, so i used claude to format it

11

u/Goncalerta Oct 24 '26

I'd personally prefer to read broken english than LLM-written reddit comments

4

u/EishLekker Oct 24 '26

You are absolutely right. Your original comment brought up a fair point, and I incorrectly responded using an LLM without justification.

6

u/Honeybadger2198 Oct 24 '26

And that's on me—

2

u/pint_o_paint Oct 25 '26

it's actually painful to read that. Make it stop

-6

u/CalebXiaYizhou Oct 24 '26

Are you mentally unwell?

1

u/chiya_coffee Oct 24 '26

Yes. How'd you know?