Quote:
Originally Posted by ahi
The correct/ideal output would be:
\texit{text\textbf{text}}\textbf{text}
i.e.: the second one, as per your examples above.
Why? Simply because our progression is from left to right, I think.
|
Which certainly generates the 'smallest' output code, and most efficient. To do that, of course, as someone else mentioned, means that you have to keep a "format stack" so that you know which format was turned on in which order, so that you can properly "back them off" in the right order.
Of course, as you're aware, there WILL be "improperly formatted" HTML/RTF input files where the italics/bold formatting overlaps and they're not turned off/on cleanly. In that case, you SHOULD convert it to clean formatting. ie, using ()'s instead of []'s for visuals:
text(I)text(B)text(/I)text(/B) ==> texttexttexttext
should be "cleaned up" to:
text(I)text(B)text(/B)(/I)(B)text(/B) ==> texttexttexttext
At least, IMHO.