[Seaside] dangling close tags as text (was re: [BUG] in IAHtmlParser)
Avi Bryant
avi@beta4.com
Fri, 29 Mar 2002 14:28:57 -0800 (PST)
Ok, this is now in SSVS - although the parse tree of invalid HTML like
<span><table></table></span> will still be structurally different from
your expectations, every byte of input text is preserved during output:
!IAHtmlParser methodsFor: 'as yet unclassified' stamp: 'AB 3/29/2002 14:12'!
closeTag: aTag
| toClose |
toClose _ nodeStack reversed
detect: [:n | n name = aTag name asLowercase]
ifNone: [^ self danglingCloseTag: aTag].
toClose hadCloseTag: true.
nodeStack _ nodeStack copyUpTo: toClose.! !
!IAHtmlParser methodsFor: 'as yet unclassified' stamp: 'AB 3/29/2002 14:13'!
danglingCloseTag: aTag
self nextText: '</', aTag name, '>'! !