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:
@@ -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>");
|
||||
|
Reference in New Issue
Block a user