MarkupParser: Make sure added paragraphs are valid
They need to contain at least one TextSpan, even if empty.
This commit is contained in:
@@ -290,6 +290,11 @@ MarkupParser::_FinishParagraph(bool isLast)
|
|||||||
if (!isLast)
|
if (!isLast)
|
||||||
fCurrentParagraph.Append(TextSpan("\n", *fCurrentCharacterStyle));
|
fCurrentParagraph.Append(TextSpan("\n", *fCurrentCharacterStyle));
|
||||||
|
|
||||||
|
if (fCurrentParagraph.IsEmpty()) {
|
||||||
|
// Append empty span
|
||||||
|
fCurrentParagraph.Append(TextSpan("", fNormalStyle));
|
||||||
|
}
|
||||||
|
|
||||||
fTextDocument->Append(fCurrentParagraph);
|
fTextDocument->Append(fCurrentParagraph);
|
||||||
fCurrentParagraph.Clear();
|
fCurrentParagraph.Clear();
|
||||||
fCurrentParagraph.SetStyle(fParagraphStyle);
|
fCurrentParagraph.SetStyle(fParagraphStyle);
|
||||||
|
|||||||
Reference in New Issue
Block a user