Skip to content
Permalink
Browse files

update also htmlToMarkdown in the crash report fix #31629

  • Loading branch information
Gustry authored and nyalldawson committed Mar 30, 2020
1 parent a6113f0 commit 55ca2a4dde8dbbf7ab79a3bb95f6fc625daa3e0d
Showing with 4 additions and 2 deletions.
  1. +2 −2 src/core/qgsstringutils.cpp
  2. +2 −0 src/crashhandler/qgscrashreport.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( "<br>" ), QLatin1String( "\n" ) );
converted.replace( QLatin1String( "<b>" ), 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 );
@@ -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( "<br>" ), QLatin1String( "\n" ) );
converted.replace( QLatin1String( "<b>" ), 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 );

0 comments on commit 55ca2a4

Please sign in to comment.
You can’t perform that action at this time.