From ad2cdb2c9474b7ac37eeae0bf932d01bcfc51c2d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 6 Nov 2014 15:24:44 +0100 Subject: [PATCH] qdoc: Remove CR from command parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although it is not recommended, it is allowed to have a carriage return in a qdoc command parameter that is enclosed in curly braces. qdoc is supposed to use QString::simplified() to sanitize the string so that all whitespace is replaced by a single ' '. But in at least one case, this didn't work, and the carriage return was left in the string, which caused qdoc to report that it couldn't find links that have the carriage return in them. The problem has been fixed by replacing the carriage return with a ' ' right when and where it is detected. Change-Id: I31c31f19a1e4150b2e27613ecbac260c46a7109b Task-number: QTBUG-42449 Reviewed-by: Topi Reiniƶ --- src/tools/qdoc/doc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index c4a2c8029b..c10e3b4669 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -2324,7 +2324,10 @@ QString DocParser::getBracedArgument(bool verbatim) } break; default: - arg += in[pos]; + if (in[pos].isSpace() && !verbatim) + arg += QChar(' '); + else + arg += in[pos]; pos++; } }