Skip to content

Commit

Permalink
html regex fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
corybolar committed Jun 13, 2017
1 parent 3b16d6c commit d4c966f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/pxminireader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,5 @@ bool PXMIniReader::getUpdates() const
#ifdef _WIN32
return iniFile->value("config/Autoupdate", true).toBool();
#endif
return false;
}
2 changes: 1 addition & 1 deletion src/pxmmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ int PXMWindow::sendButtonClicked()

if (!(ui->textEdit->toPlainText().isEmpty())) {
QString fixedURLS = ui->textEdit->toHtml();
QRegularExpression urls("(https?://([a-zA-Z0-9_-]+.)?[a-zA-Z0-9_-]+.[a-z]{2,3})");
QRegularExpression urls("(https?://([a-zA-Z0-9_-]+.)?[a-zA-Z0-9_-]+[^< ]*)");
QString body = fixedURLS.right(fixedURLS.length() - fixedURLS.indexOf("<html>"));
body.replace(urls, "<a href=\"\\1\">\\1</a>");
fixedURLS = fixedURLS.left(fixedURLS.indexOf("<html>")) % body;
Expand Down

0 comments on commit d4c966f

Please sign in to comment.