Live data from Hacker News

Overlapping markup

en.wikipedia.org

41–48 of 48 posts

Re: Overlapping markup

#41

There are so many odd edge cases in HTML, a good one I found was with forms. If you open a but don't have a closing tag, the browser will close the form block "visually" at the end of the forms immediate parent, as you would expect. All styles are applied to it, or children via selectors, up to that automatically inserted end point. It's how browsers handles most unclosed block tags. However, the forms "functionality…

Why didn't they go the grammar nazi route? Define a spec and if the page doesn't conform, draw an error message. It's really annoying to have this kind of undefined behaviour that might end up being relied upon.

XHTML was an attempt at such strictness. It failed, though you can still use XML syntax for HTML if you choose to (serve it with MIME type application/xhtml+xml instead of text/html). I leave you to research why it failed if you want; plenty has been written on the topic.

In the mid-2000s, HTML syntax was finally codified. There is now no undefined behaviour: all inputs have a defined output, however surprising may be, because a lot of it was being relied upon.

Re: Overlapping markup

#43

Change my view: given any data storage medium, the smallest granularity of data must also be the most-child element of any markup language. Given the immense overhead of storing markups on a granular level, processing markup therefore must be a perpetual exercise in recursion. I.e. Poem->Verse->Line-> Book->Page->Chapter->Paragraph->Sentence->Word-> HTML->Body->Div->P-> Therefore, any given letter (here as a type) ca…

If I'm understanding you correctly, in that model a Paragraph should have a parent Page (and there should be a clear answer to the question "what page is this paragraph on?"). Is that correct? If so, that doesn't match how most paginated texts are formatted, where paragraphs frequently start on one page but finish on another

Re: Overlapping markup

#44
FrontPage used an interval tree to represent misnested HTML tags. The browsers would interpret the tags as covering the contained area using ad-hoc parsing techniques (e.g. simply keeping a running character property stack to handle font, b, i tags). Frontpage tried to preserve all the tags and the structure it saw on input while also producing the same visual output so it had a tougher problem. (I wrote that interval tree code.)

Re: Overlapping markup

#45

Wouldnt one obvious solution be to allow tags from different namespaces to overlap? Maybe it is mentioned in the article but I could not see it: This is some content that is split into two nodes Then in this case two trees with common leaf nodes (4 text nodes) are constructed. From point of ns2-root there are only 3 children (the 2 next nodes outside and the ) and from point fof ns1-root there are two children (elemA…

parser error : Opening and ending tag mismatch

Re: Overlapping markup

#46
'Tag soup' might not be perfect, but then neither are widely-used languages that - if they spot a single misplaced period or missing comma or a couple of extra characters after a right-curly-bracket - just QUIT. Why that sort of fragility is tolerated, even lauded is beyond me. That HTML just ignores any tag it can't recognize, without stomping a foot, means all the others are available for other uses. Great!

Re: Overlapping markup

#47

This Wikipedia article is sorely lacking concrete examples to help aid understanding.. Anyone care to add some examples to the article??

Book-like indices are a notable example. A book index is a list of topics with references to pages. A topic may very easily overlap with another topic and all indexing tools imply that. For example, XSL-FO is an XML-based notation, so in general it is strictly hierarchical: a tag encloses other tags. For index entries, however, it uses disjoint tags like `` and `` linked via the `id/ref-id` attributes.

Re: Overlapping markup

#48
CCS/CCMS (Component Content Systems / Component Content Management Systems) require overlap in order to function. Sort of a "the phone call is coming from inside the house" moment.

It's probably worth noting that I've never seen a CCMS that works well, yet CCS is to-this-day the Holy Grail for most content technologists. It's a little bit mad.

Post reply on HN