MSHTML:IMarkupPointer - Strange behavior with overlapping tags [modified]
-
I experienced a strange behavior with overlapping tags. I use the IMarkupServices interface with IMarkupPointer to parse a document and display the "class" attribute of the currently selected
<font>
tag, if any (just like Winword displays the style of the current selection). When I parse the following code (after selecting the text portion marked green in the view), strange things happen:some text<font class="g3">Normal<font class="g4">Big</font>Normal</font>some other text
TheIMarkupPointer pHtmlStart
starts at the right point, but when it moves on after looping once and successfully retrieving the "class" attribute,pHtmlStart->CurrentScope
returns a NULL element and seems to have gotten RIGHT of thepHtmlEnd
pointer. Due to this behavior, I cannot retrieve any other elements in the selection, thus I am not able to indicate "there are elements with different CLASS attributes in the selection.". Has anybody experienced something like this? Or is there another solution to the problem? Anybody knows how FrontPage handles this? Or am I doing something totally wrong? If anybody is interested I will post some code here to evaluate the behavior. Thanks for reading. -- modified at 3:18 Friday 7th July, 2006