Skip to content

Commit

Permalink
update also htmlToMarkdown in the crash report
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Mar 30, 2020
1 parent ca05a8b commit 65aeae3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsstringutils.cpp
Expand Up @@ -450,7 +450,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( "**" ) );
Expand All @@ -461,7 +461,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 );
Expand Down
2 changes: 2 additions & 0 deletions src/crashhandler/qgscrashreport.cpp
Expand Up @@ -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( "**" ) );
Expand All @@ -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 );
Expand Down

0 comments on commit 65aeae3

Please sign in to comment.