diff options
author | DeepBlueV7.X <nicolas.werner@hotmail.de> | 2021-06-25 17:27:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 17:27:15 +0000 |
commit | fddc558b23573dd780fad8acdcab70561c54b144 (patch) | |
tree | 18b3fb2e1fb0ba8a4c57359d082cdf16920ffba9 | |
parent | Try to fix appveyor (diff) | |
parent | Apply suggestions from code review (diff) | |
download | nheko-fddc558b23573dd780fad8acdcab70561c54b144.tar.xz |
Merge pull request #624 from Cadair/inline_img_single_quote
Add another regex to match inline img tags using single quotes
-rw-r--r-- | src/timeline/TimelineModel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 067f219a..5f92aaae 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, |