mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09:52 +08:00
export: escape ' by %27 in data URI
This commit is contained in:
parent
b88694bf3a
commit
7305706294
@ -926,6 +926,7 @@ QString VWebUtils::copyResource(const QUrl &p_url, const QString &p_folder) cons
|
|||||||
return succ ? targetFile : QString();
|
return succ ? targetFile : QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Please use single quote to quote the URI.
|
||||||
QString VWebUtils::dataURI(const QUrl &p_url, bool p_keepTitle) const
|
QString VWebUtils::dataURI(const QUrl &p_url, bool p_keepTitle) const
|
||||||
{
|
{
|
||||||
QString uri;
|
QString uri;
|
||||||
@ -961,6 +962,9 @@ QString VWebUtils::dataURI(const QUrl &p_url, bool p_keepTitle) const
|
|||||||
// will be removed in M68, around July 2018. Please use '%23' instead.
|
// will be removed in M68, around July 2018. Please use '%23' instead.
|
||||||
uri.replace("#", "%23");
|
uri.replace("#", "%23");
|
||||||
|
|
||||||
|
// Escape "'" to avoid conflict with src='...' attribute.
|
||||||
|
uri.replace("'", "%27");
|
||||||
|
|
||||||
if (!p_keepTitle) {
|
if (!p_keepTitle) {
|
||||||
// Remove <title>...</title>.
|
// Remove <title>...</title>.
|
||||||
QRegExp reg("<title>.*</title>", Qt::CaseInsensitive);
|
QRegExp reg("<title>.*</title>", Qt::CaseInsensitive);
|
||||||
|
@ -26,6 +26,7 @@ public:
|
|||||||
QString copyResource(const QUrl &p_url, const QString &p_folder) const;
|
QString copyResource(const QUrl &p_url, const QString &p_folder) const;
|
||||||
|
|
||||||
// Return a dataURI of @p_url if it is an image.
|
// Return a dataURI of @p_url if it is an image.
|
||||||
|
// Please use single quote to quote the URI.
|
||||||
QString dataURI(const QUrl &p_url, bool p_keepTitle = true) const;
|
QString dataURI(const QUrl &p_url, bool p_keepTitle = true) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user