From d60ea38cb8acfcab5b9f952e7b56d0f079001642 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 25 Jun 2021 12:14:45 +0100 Subject: [PATCH] Add another regex to match inline img tags using single quotes Signed-off-by: Stuart Mumford --- src/timeline/TimelineModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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( "(]*)src=\"mxc://([^\"]*)\"([^>]*>)"); formattedBody_.replace(matchImgUri, "\\1 src=\"image://mxcImage/\\2\"\\3"); + // Same regex but for single quotes around the src + const static QRegularExpression matchImgUri2( + "(]*)src=\'mxc://([^\"]*)\'([^>]*>)"); + formattedBody_.replace(matchImgUri2, "\\1 src=\"image://mxcImage/\\2\"\\3"); const static QRegularExpression matchEmoticonHeight( "(]*)height=\"([^\"]*)\"([^>]*>)"); formattedBody_.replace(matchEmoticonHeight,