From 4f314567b6a8d87d472c3388523a3e093560b652 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Thu, 22 Dec 2022 04:10:25 +0100 Subject: [PATCH] XML: improve formatting of error message for unrecognised tag type. Before, there was always a space after the tag, even when there were no attributes. Now, the space is output conditionally, so that the output makes more sense. Before, one space too many for the tag name (title), casting doubt on whether the code had this space hard coded or not: After, no such space: --- src/xml.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xml.cpp b/src/xml.cpp index 7ee8d9137a..f466f61283 100644 --- a/src/xml.cpp +++ b/src/xml.cpp @@ -812,7 +812,8 @@ void xml::openTag(XMLStream & xs, const docstring & tag, const docstring & attr, else if (tagtype == "none") xs << xml::StartTag(tag, attr); else - xs.writeError("Unrecognised tag type '" + tagtype + "' for '" + to_utf8(tag) + " " + to_utf8(attr) + "'"); + xs.writeError("Unrecognised tag type '" + tagtype + "' for '" + to_utf8(tag) + (attr.empty() ? "" : " ") + + to_utf8(attr) + "'"); }