* Convert the value of \ attribute of \ element from cppcheck's * XML-output to 'good-looking' HTML-version. This is necessary because the * displaying of the original message is performed without line breaks - such * tooltips are uncomfortable to read, and large messages will not fit into the * screen. * * This function put the original message into \ tag that autom
| 40 | * @return HTML version for displaying in problem's tooltip |
| 41 | */ |
| 42 | QString verboseMessageToHtml( const QString & input ) |
| 43 | { |
| 44 | QString output(QStringLiteral("<html>%1</html>").arg(input.toHtmlEscaped())); |
| 45 | |
| 46 | output.replace(QLatin1String("\\012"), QLatin1String("\n")); |
| 47 | |
| 48 | if (output.count(QLatin1Char('\n')) >= 2) { |
| 49 | output.replace(output.indexOf(QLatin1Char('\n')), 1, QStringLiteral("<pre>") ); |
| 50 | output.replace(output.lastIndexOf(QLatin1Char('\n')), 1, QStringLiteral("</pre><br>") ); |
| 51 | } |
| 52 | |
| 53 | return output; |
| 54 | } |
| 55 | |
| 56 | CppcheckParser::CppcheckParser() |
| 57 | { |
no test coverage detected