diff --git a/mainwindow.cc b/mainwindow.cc index 6f6f5470..3f6a98b8 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -3279,6 +3279,19 @@ void MainWindow::on_saveArticle_triggered() QFileInfo fi( fileName ); cfg.articleSavePath = QDir::toNativeSeparators( fi.absoluteDir().absolutePath() ); + // Convert internal links + + QRegExp rx3( "href=\"(bword:|gdlookup://localhost/)([^\"]+)\"" ); + int pos = 0; + while ( ( pos = rx3.indexIn( html, pos ) ) != -1 ) + { + QString name = QUrl::fromPercentEncoding( rx3.cap( 2 ).simplified().toLatin1() ); + name.replace( rxName, "_" ); + name = QString( "href=\"" ) + QUrl::toPercentEncoding( name ) + ".html\""; + html.replace( pos, rx3.cap().length(), name ); + pos += name.length(); + } + if ( complete ) { QString folder = fi.absoluteDir().absolutePath() + "/" + fi.baseName() + "_files"; @@ -3308,19 +3321,6 @@ void MainWindow::on_saveArticle_triggered() } } - // Convert internal links - - QRegExp rx3( "href=\"(bword:|gdlookup://localhost/)([^\"]+)\"" ); - int pos = 0; - while ( ( pos = rx3.indexIn( html, pos ) ) != -1 ) - { - QString name = QUrl::fromPercentEncoding( rx3.cap( 2 ).simplified().toLatin1() ); - name.replace( rxName, "_" ); - name = QString( "href=\"" ) + QUrl::toPercentEncoding( name ) + ".html\""; - html.replace( pos, rx3.cap().length(), name ); - pos += name.length(); - } - progressDialog->setLabelText( tr("Saving article...") ); progressDialog->setRange( 0, maxVal ); progressDialog->setValue( 0 );