Changeset View
Changeset View
Standalone View
Standalone View
libdiscover/backends/KNSBackend/KNSResource.cpp
Context not available. | |||||
79 | if(newLine>0) { | 79 | if(newLine>0) { | ||
---|---|---|---|---|---|
80 | ret=ret.left(newLine); | 80 | ret=ret.left(newLine); | ||
81 | } | 81 | } | ||
82 | ret = ret.replace(QRegularExpression(QStringLiteral("\\[/?[a-z]*\\]")), QString()); | 82 | ret = ret.replace(QRegularExpression(QStringLiteral("\\[\\/?[a-z]*\\]")), QString()); | ||
83 | ret = ret.remove(QRegularExpression(QStringLiteral("<[^>]*>"))); | 83 | ret = ret.remove(QRegularExpression(QStringLiteral("<[^>]*>"))); | ||
84 | } | 84 | } | ||
85 | return ret; | 85 | return ret; | ||
Context not available. | |||||
97 | } | 97 | } | ||
98 | ret = ret.replace(QLatin1Char('\r'), QString()); | 98 | ret = ret.replace(QLatin1Char('\r'), QString()); | ||
99 | ret = ret.replace(QStringLiteral("[li]"), QStringLiteral("\n* ")); | 99 | ret = ret.replace(QStringLiteral("[li]"), QStringLiteral("\n* ")); | ||
100 | ret = ret.replace(QRegularExpression(QStringLiteral("\\[/?[a-z]*\\]")), QString()); | 100 | // Get rid of all BBCode markup we don't handle above | ||
101 | ret = ret.replace(QRegularExpression(QStringLiteral("\\[\\/?[a-z]*\\]")), QString()); | ||||
102 | // Find anything that looks like a link (but which also is not some html | ||||
103 | // tag value or another already) and make it a link | ||||
104 | static const QRegularExpression urlRegExp(QStringLiteral("(^|\\s)([-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:;%_\\+.~#?&//=]*)?)"), QRegularExpression::CaseInsensitiveOption); | ||||
105 | ret = ret.replace(urlRegExp, QStringLiteral("<a href=\"\\2\">\\2</a>")); | ||||
101 | return ret; | 106 | return ret; | ||
102 | } | 107 | } | ||
103 | 108 | | |||
Context not available. |