slowwriter | 10 months ago | on: Find the Odd Disk
slowwriter's comments
slowwriter | 1 year ago | on: Open Source Alternative to Vercel, Netlify and Heroku
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
slowwriter | 2 years ago | on: Tell HN: How an elderly couple I know had their computer 'stop working'
Well, add that to the list of things that didn't prevent or solve the problem, unfortunately.
Also, I was thinking: If I was in that situation I might SSH into it from a different machine. Yeah, good luck with that to the elderly couple.
slowwriter | 2 years ago | on: How Apple's developers reflashed Mac ROMs in the '90s
slowwriter | 2 years ago | on: How Apple's developers reflashed Mac ROMs in the '90s
slowwriter | 2 years ago | on: How I Made a Heap Overflow in Curl
slowwriter | 2 years ago | on: Space After Periods (1993)
I’m going to have to look further into this to get a better understanding, but I suppose the rules for collapsing whitespace in a text node exist somewhere in the HTML specification, but not at the “interpretation” stage as I assumed.
To be clear what I imagined was that at the interpretation stage a text node would be marked to begin at the first non-whitespace character and end at the last non-whitespace character. And then within the text node there might be additional whitespace that would need to be collapsed into a single space.
Since the first type is not rendered at all and the second type is collapsed to a single space I assumed the rules could exist at two different points in the process/pipeline.
So what I gather here is that both types exist at a later stage than “interpretation” (basically what you see when you open Developer Tools and inspect individual nodes).
But I guess the subtlety here is that at whichever stage the whitespace collapsing/removal happens, the rules for it would still have to be defined by the HTML specification somehow.
And another subtlety to counteract that is that HTML is a markup language and not a programming language. One is executed, one is rendered. So any comparison between say Python and HTML needs to take that into account.
So even though there is some whitespace ignoring going on at some point from:
<p>[whitespace]This textnode has extraneous whitespace[whitespace]</p>
To the point where [whitespace] is not rendered in the viewport, the fact that the ignoring does not happen at the “interpretation” stage is important because that’s as far as the comparison between say Python and HTML can go before the two veer off in different directions.
I’m mainly typing this out for my own understanding, but again, will have to look into it myself to validate or correct my current framework of thinking about this. Thanks for an interesting discussion
slowwriter | 2 years ago | on: Space After Periods (1993)
Also, this is an example of whitespace that is ignored:
<p>[whitespace here]I’m a text node[more whitespace here]</p>
I don’t believe that is what you referred to when you said “inside angle brackets around attributes and element names”.
Here the whitespace or sequence of spacelike characters is not collapsed into a single space. It is simply ignored, and the text node (string) begins at the first non-whitespace character.
That is actually what I referred to when I said that you end up adding a lot of extra whitespace when building a website in, say, PHP. Because that is where it typically ends up in the generated output.
slowwriter | 2 years ago | on: Space After Periods (1993)
When you put plain text into an element, that is equivalent to a string in typical programming terms. No, whitespace is not entirely insignificant within a text node. But almost. If we leave out <pre> and other special cases here, HTML specifies to ignore any extraneous whitespace and simply collapse it into a single space. So it is “extraneous whitespace insignificant” in a sense. It doesn’t ignore whitespace interely, but no one would expect that in the contex of a string in any language, even a whitespace insignificant one.
In a text node HTML goes out of it’s way to minimize the meaning of whitespace, but it does do the minimum of respecting that words have spaces between them. You can put spaces some places and have it break or change stuff, like in the middle of an attribute name or value, in the middle of an element name, etc. But you would expect that to happen in any whitespace insignificant language. Outside of that and a few special cases, the default behavior is to ignore whitespace (for example whitespace between the beginning or ending tag of an element and the text node it contains), and as such HTML is very much whitespace insignificant in my opinion.
The reason why I commented that this design was absolutely the right call is basically cases like building a website in PHP, where you mix the two languages together. Here you end up adding a lot of whitespace from indenting your code, etc., and it would be a nightmare if HTML didn’t treat whitespace as it does.
slowwriter | 2 years ago | on: Space After Periods (1993)