Skip to content

Commit

Permalink
support escape syntax. $$qgis_version will be kept and $qgis_version
Browse files Browse the repository at this point in the history
will be replaced with value
  • Loading branch information
alexbruy committed Jan 10, 2017
1 parent f77e677 commit c5b3b1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/qgshelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <QFileInfo>
#include <QTcpSocket>
#include <QDesktopServices>
#include <QRegularExpression>
#include <QNetworkProxy>
#include <QNetworkProxyFactory>

Expand Down Expand Up @@ -54,7 +55,8 @@ QUrl QgsHelp::helpUrl( const QString& key )
fullPath = path;
Q_FOREACH ( const QString& var, scope->variableNames() )
{
fullPath.replace( QStringLiteral( "$%1" ).arg( var ), scope->variable( var ).toString() );
QRegularExpression rx( QStringLiteral( "(?<!\\$)\\$%1" ).arg( var ) );
fullPath.replace( rx, scope->variable( var ).toString() );
}

helpPath = QStringLiteral( "%1/%2" ).arg( fullPath ).arg( key );
Expand Down

0 comments on commit c5b3b1a

Please sign in to comment.