mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
Add another regex to match inline img tags using single quotes
Signed-off-by: Stuart Mumford <stuart@cadair.com>
This commit is contained in:
parent
36f0e04439
commit
d60ea38cb8
1 changed files with 4 additions and 0 deletions
|
@ -532,6 +532,10 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
|
||||||
const static QRegularExpression matchImgUri(
|
const static QRegularExpression matchImgUri(
|
||||||
"(<img [^>]*)src=\"mxc://([^\"]*)\"([^>]*>)");
|
"(<img [^>]*)src=\"mxc://([^\"]*)\"([^>]*>)");
|
||||||
formattedBody_.replace(matchImgUri, "\\1 src=\"image://mxcImage/\\2\"\\3");
|
formattedBody_.replace(matchImgUri, "\\1 src=\"image://mxcImage/\\2\"\\3");
|
||||||
|
// Same regex but for single quotes around the src
|
||||||
|
const static QRegularExpression matchImgUri2(
|
||||||
|
"(<img [^>]*)src=\'mxc://([^\"]*)\'([^>]*>)");
|
||||||
|
formattedBody_.replace(matchImgUri2, "\\1 src=\"image://mxcImage/\\2\"\\3");
|
||||||
const static QRegularExpression matchEmoticonHeight(
|
const static QRegularExpression matchEmoticonHeight(
|
||||||
"(<img data-mx-emoticon [^>]*)height=\"([^\"]*)\"([^>]*>)");
|
"(<img data-mx-emoticon [^>]*)height=\"([^\"]*)\"([^>]*>)");
|
||||||
formattedBody_.replace(matchEmoticonHeight,
|
formattedBody_.replace(matchEmoticonHeight,
|
||||||
|
|
Loading…
Reference in a new issue