Skip to content

Commit 55ca2a4

Browse files
Gustrynyalldawson
authored andcommittedMar 30, 2020
update also htmlToMarkdown in the crash report fix #31629
1 parent a6113f0 commit 55ca2a4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎src/core/qgsstringutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ QString QgsStringUtils::insertLinks( const QString &string, bool *foundLinks )
556556

557557
QString QgsStringUtils::htmlToMarkdown( const QString &html )
558558
{
559-
559+
// Any changes in this function must be copied to qgscrashreport.cpp too
560560
QString converted = html;
561561
converted.replace( QLatin1String( "<br>" ), QLatin1String( "\n" ) );
562562
converted.replace( QLatin1String( "<b>" ), QLatin1String( "**" ) );
@@ -567,7 +567,7 @@ QString QgsStringUtils::htmlToMarkdown( const QString &html )
567567
while ( hrefRegEx.indexIn( converted, offset ) != -1 )
568568
{
569569
QString url = hrefRegEx.cap( 1 ).replace( QStringLiteral( "\"" ), QString() );
570-
url.replace( QStringLiteral( "'" ), QString() );
570+
url.replace( '\'', QString() );
571571
QString name = hrefRegEx.cap( 2 );
572572
QString anchor = QStringLiteral( "[%1](%2)" ).arg( name, url );
573573
converted.replace( hrefRegEx, anchor );

‎src/crashhandler/qgscrashreport.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ QString QgsCrashReport::crashReportFolder()
171171

172172
QString QgsCrashReport::htmlToMarkdown( const QString &html )
173173
{
174+
// Any changes in this function must be copied to qgsstringutils.cpp too
174175
QString converted = html;
175176
converted.replace( QLatin1String( "<br>" ), QLatin1String( "\n" ) );
176177
converted.replace( QLatin1String( "<b>" ), QLatin1String( "**" ) );
@@ -181,6 +182,7 @@ QString QgsCrashReport::htmlToMarkdown( const QString &html )
181182
while ( hrefRegEx.indexIn( converted, offset ) != -1 )
182183
{
183184
QString url = hrefRegEx.cap( 1 ).replace( QStringLiteral( "\"" ), QString() );
185+
url.replace( '\'', QString() );
184186
QString name = hrefRegEx.cap( 2 );
185187
QString anchor = QStringLiteral( "[%1](%2)" ).arg( name, url );
186188
converted.replace( hrefRegEx, anchor );

0 commit comments

Comments
 (0)
Please sign in to comment.