From 55ca2a4dde8dbbf7ab79a3bb95f6fc625daa3e0d Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Sat, 28 Mar 2020 09:42:40 +0100 Subject: [PATCH] update also htmlToMarkdown in the crash report fix #31629 --- src/core/qgsstringutils.cpp | 4 ++-- src/crashhandler/qgscrashreport.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/qgsstringutils.cpp b/src/core/qgsstringutils.cpp index 35d457107cd..7cbadccd634 100644 --- a/src/core/qgsstringutils.cpp +++ b/src/core/qgsstringutils.cpp @@ -556,7 +556,7 @@ QString QgsStringUtils::insertLinks( const QString &string, bool *foundLinks ) QString QgsStringUtils::htmlToMarkdown( const QString &html ) { - + // Any changes in this function must be copied to qgscrashreport.cpp too QString converted = html; converted.replace( QLatin1String( "
" ), QLatin1String( "\n" ) ); converted.replace( QLatin1String( "" ), QLatin1String( "**" ) ); @@ -567,7 +567,7 @@ QString QgsStringUtils::htmlToMarkdown( const QString &html ) while ( hrefRegEx.indexIn( converted, offset ) != -1 ) { QString url = hrefRegEx.cap( 1 ).replace( QStringLiteral( "\"" ), QString() ); - url.replace( QStringLiteral( "'" ), QString() ); + url.replace( '\'', QString() ); QString name = hrefRegEx.cap( 2 ); QString anchor = QStringLiteral( "[%1](%2)" ).arg( name, url ); converted.replace( hrefRegEx, anchor ); diff --git a/src/crashhandler/qgscrashreport.cpp b/src/crashhandler/qgscrashreport.cpp index 35a3f54aaea..5655efe5d61 100644 --- a/src/crashhandler/qgscrashreport.cpp +++ b/src/crashhandler/qgscrashreport.cpp @@ -171,6 +171,7 @@ QString QgsCrashReport::crashReportFolder() QString QgsCrashReport::htmlToMarkdown( const QString &html ) { + // Any changes in this function must be copied to qgsstringutils.cpp too QString converted = html; converted.replace( QLatin1String( "
" ), QLatin1String( "\n" ) ); converted.replace( QLatin1String( "" ), QLatin1String( "**" ) ); @@ -181,6 +182,7 @@ QString QgsCrashReport::htmlToMarkdown( const QString &html ) while ( hrefRegEx.indexIn( converted, offset ) != -1 ) { QString url = hrefRegEx.cap( 1 ).replace( QStringLiteral( "\"" ), QString() ); + url.replace( '\'', QString() ); QString name = hrefRegEx.cap( 2 ); QString anchor = QStringLiteral( "[%1](%2)" ).arg( name, url ); converted.replace( hrefRegEx, anchor );