Don't write spurious </font> to wxRichText HTML output

The opening <font> tag was only written to the output if the style had a
non-default font, but the matching closing tag wasn't guarded by the
same check.

Do add the check now to ensure that the tags are always balanced.

Closes #18157.
This commit is contained in:
Vadim Zeitlin
2018-07-04 20:09:49 +02:00
parent 5e5f878db0
commit 6d02c45867

View File

@@ -166,7 +166,8 @@ bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream&
CloseLists(-1, str);
str << wxT("</font>");
if (currentParaStyle.HasFont())
str << wxT("</font>");
if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
str << wxT("</body></html>");