summary refs log tree commit diff
diff options
context:
space:
mode:
authorStuart Mumford <stuart@cadair.com>2021-06-25 12:14:45 +0100
committerStuart Mumford <stuart@cadair.com>2021-06-25 12:14:45 +0100
commitd60ea38cb8acfcab5b9f952e7b56d0f079001642 (patch)
tree6d67888371b77c23c40393eb961d7bf4a181ac35
parentMerge pull request #610 from Nheko-Reborn/spaces (diff)
downloadnheko-d60ea38cb8acfcab5b9f952e7b56d0f079001642.tar.xz
Add another regex to match inline img tags using single quotes
Signed-off-by: Stuart Mumford <stuart@cadair.com>
-rw-r--r--src/timeline/TimelineModel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 067f219a..5d2d5a68 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -532,6 +532,10 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r const static QRegularExpression matchImgUri( "(<img [^>]*)src=\"mxc://([^\"]*)\"([^>]*>)"); 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( "(<img data-mx-emoticon [^>]*)height=\"([^\"]*)\"([^>]*>)"); formattedBody_.replace(matchEmoticonHeight,