3 ms·
Atom is correct to a degree that is annoying. It is XML, so not all HTML5 is allowed. You would have to convert your HTML5 to XHTML5. Possible but harder than
by qznc 4mo ago
Atom is correct to a degree that is annoying.
It is XML, so not all HTML5 is allowed. You would have to convert your HTML5 to XHTML5. Possible but harder than string-concatenation.
It requires full self links, so you must put your domain name in there as relative links would be an error. When using a static generator, why should I care where the files are published?
My website has valid Atom feeds. Still, it's an annoying format to me.
- inigyou 4mo agoAnd those three ways to encode a title. Do I really imagine that every parser is going to undo the double-encoding correctly? Or XHTML conversion if I use a namespace prefix?
- chrismorgan 4mo ago… yes? It’s simple XML parsing, and then taking it as text, serialised HTML, or an already-parsed DOM tree. You are using an actual XML parser, right? In most environments it’s no harder, and in browsers themselves (which is where half of it is consumed) it’s arguably easier.
- inigyou 4mo agothe DOM tree is going to say either html:code or {http://something}code neither of which is just code.
- chrismorgan 4mo agoWhen an XML document contains HTML, the DOM representation is of elements in the http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml namespace. When you parse a document or fragment that is in HTML syntax, the DOM representation is of elements in the http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml namespace. There is no difference.
- inigyou 4mo agoHope your parser implements all this correctly!
- chrismorgan 4mo agoIt’s genuinely easier to get it right than to get it wrong.
- qznc 4mo agoHTML5 is not XML. You don’t need to close your <p> for example. If I include such valid HTML5 into Atom it is invalid XML. Well, I can use <![CDATA but that is weird too.
- chrismorgan 4mo agoYou’re talking about writing it. The question here is reading it.
- talideon 4mo agoYou don't have to convert anything to XHTML5. You only need to do that if you specify type="xhtml" on an element, but you can use="html" and escape the markup. RSS has this behaviour too, but it's spelled out better in Atom. I suspect you've been making your lifeIfe difficult for no good reason. > why should I care where the files are published? You don't, but those consuming your feed do. You do it for their benefit.