Live data from Hacker News

Overlapping markup

en.wikipedia.org

1–10 of 48 posts

Re: Overlapping markup

#4

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

The "Approaches and implementations" section includes some clear (to my eyes at least) examines of overlapping lines and sentences in poetry represented as html-like markup.

What sort of examples would improve the article's clarity for you?

Wrt the existing examples, perhaps there should be a small section before that, explicitly called "examples", that contains a minimal summary of those examples to illustrate the concept before the reader delves deeper.

Re: Overlapping markup

#5

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

overlapping b and i elements

hello world

contary to the article it can still be represented as a tree, by decomposing the children into their own nodes (so in this case characters become nodes with child nodes expressing what formatting is active, followed by the letter, and then turn of all the active formatting)

Re: Overlapping markup

#6
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) can retain a back reference of parents, so the object retains a hashset of {Line,Word,P} parent type references representing three domains, but really needs to be a Dictionary of key values, the key being the domain name, the value being the parent name, so that would be:

Domain: Poetry, Value: Line

Domain: Book Object Model, Value: Word

Domain: HTML, Value: P Element

We could then ask any letter arbitrarily "what is your Font Style in your HTML context?" and it would be able to walk up the parent P which obtains its style from a CSS markup, and return that correctly. Or "What is your Poem's name in your Poetry context?" and it could recurse up to the Poem element to find it's Title.

Re: Overlapping markup

#7
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" isn't closed at that point, any inputs further down the page (outside of the forms DOM tree) are included in the post/get when the form is submitted. Or at least until another form is found in the DOM. Effectively an unclosed form is two things, a visual block that is closed automatically, and an "overlapping" form capturing inputs indefinitely.

Re: Overlapping markup

#8

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

The "Approaches and implementations" section includes some clear (to my eyes at least) examines of overlapping lines and sentences in poetry represented as html-like markup. What sort of examples would improve the article's clarity for you? Wrt the existing examples, perhaps there should be a small section before that, explicitly called "examples", that contains a minimal summary of those examples to illustrate the c…

Yeah, I agree with what you are saying. I was viewing this article on mobile and it was hard to spot these examples on mobile, because all sections are collapsed by default and none of the sections had the examples stand out at a cursory glance on mobule. Now that I am on a laptop I easily spot them. I also agree with what you are saying that an explicit section named examples would be good. Especially for mobile reading.

Re: Overlapping markup

#9

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…

This seems strange, how is that represented in the DOM, which is strictly a tree?

Re: Overlapping markup

#10
post #9

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…

This seems strange, how is that represented in the DOM, which is strictly a tree?

It's not in the DOM, from memory chrome dev tools even shows a closing form tag where it's been inserted. I have no idea how it's implemented internally.

Confuse me for a while when debugging a legacy website. It had actually been done intentionally to work around a rather complex architecture.

Post reply on HN