HTMLDocument::InvalidNesting(String)
Arguments
- Anonymous argument: The String contains details of the error
Usage
This Exception is thrown by addInlineElementAt if the start or end positions would cause invalid nesting.
p = addParagraph(parent,"This paragraph");
em = addInlineElementAt(p,Emphasis,3,7);
code = addInlineElementAt(p,ComputerCode,6,9);
// this attempts to make <p>Thi<em>s p<code>a</em>ra</code>graph</p>
// which is invalid, and so an Exception is thrown.
This Exception is also thrown by several other functions if you try to add an element inside another element which cannot contain it.
p = addParagraph(parent,"");
list = addList(p,Unordered,0);
// lists cannot be contained inside paragraphs, so an exception is thrown