From 6d02c458676de4ebf3c5cd7a716a9c0d375e8b42 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 4 Jul 2018 20:09:49 +0200 Subject: [PATCH] Don't write spurious to wxRichText HTML output The opening 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. --- src/richtext/richtexthtml.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/richtext/richtexthtml.cpp b/src/richtext/richtexthtml.cpp index af3d8f7ff9..56261546e7 100644 --- a/src/richtext/richtexthtml.cpp +++ b/src/richtext/richtexthtml.cpp @@ -166,7 +166,8 @@ bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& CloseLists(-1, str); - str << wxT(""); + if (currentParaStyle.HasFont()) + str << wxT(""); if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0) str << wxT("");