If an image URL contains a non-ASCII character (e.g. `kartöffelchen.jpg`), the html returned by the markdown parser contains the encoded path `kart%C3%B6ffelchen.jpg`. We must decode the path before checking if the image file exists.
(cherry picked from commit 8aa96484da)
If we have code like <a><img></a><a><img></a> and the img has alt text
The old code did
remove image
insert alt text
but when we remove the image, the qtextdocument says
"i don't need the <a> anymore since there's nothing inside"
and then everything breaks because the layout has changed and we're
iterating over "unexisting" text blocks
So instead we just insert the alt text and
since we have selected the image with the cursor it will
replace it correctly
BUGS: 444971
The discount markdown parser supports parsing explicit image sizes in markdown, but we ignore them and replace them with the actual image dimensions. With this patch, any specified image sizes are respected.
find . \( -name "*.cpp" -or -name "*.h" -or -name "*.c" -or -name "*.cc" \) -exec clang-format -i {} \;
If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
When processing the <a> elements, store in two maps those that contain
an href="#Something" and those with name="Something" then once we've
processed them all, go over the first map trying to find itself in the
second
BUGS: 421163
Summary:
If we have a qrc url, all checks so far fails, and this one returns null.
It might also be possible to get here in some race condition.
Reviewers: aacid
Reviewed By: aacid
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D12643
Don't have the textdocument and dir as members, pass them along
This is to make clear that this is a "one off stateless conversion",
i.e. after convert returns the converter doesn't own the textdocument
anymore, so better don't keep a pointer to it