|
|
@@ -336,7 +336,10 @@ bool VExporter::exportToPDFViaWK(VDocument *p_webDocument,
|
|
|
}
|
|
|
|
|
|
QString htmlPath = tmpDir.filePath("vnote_tmp.html");
|
|
|
+ QString title = p_webDocument->getFile()->getName();
|
|
|
+ title = QFileInfo(title).completeBaseName();
|
|
|
if (!outputToHTMLFile(htmlPath,
|
|
|
+ title,
|
|
|
p_headContent,
|
|
|
p_styleContent,
|
|
|
p_bodyContent,
|
|
|
@@ -396,7 +399,10 @@ bool VExporter::exportToCustom(VDocument *p_webDocument,
|
|
|
}
|
|
|
|
|
|
QString htmlPath = tmpDir.filePath("vnote_tmp.html");
|
|
|
+ QString title = p_webDocument->getFile()->getName();
|
|
|
+ title = QFileInfo(title).completeBaseName();
|
|
|
if (!outputToHTMLFile(htmlPath,
|
|
|
+ title,
|
|
|
p_headContent,
|
|
|
p_styleContent,
|
|
|
p_bodyContent,
|
|
|
@@ -563,7 +569,10 @@ bool VExporter::exportToHTML(VDocument *p_webDocument,
|
|
|
|
|
|
Q_ASSERT(!p_filePath.isEmpty());
|
|
|
|
|
|
+ QString title = p_webDocument->getFile()->getName();
|
|
|
+ title = QFileInfo(title).completeBaseName();
|
|
|
if (!outputToHTMLFile(p_filePath,
|
|
|
+ title,
|
|
|
p_headContent,
|
|
|
p_styleContent,
|
|
|
p_bodyContent,
|
|
|
@@ -971,6 +980,7 @@ int VExporter::startProcess(const QString &p_cmd)
|
|
|
}
|
|
|
|
|
|
bool VExporter::outputToHTMLFile(const QString &p_file,
|
|
|
+ const QString &p_title,
|
|
|
const QString &p_headContent,
|
|
|
const QString &p_styleContent,
|
|
|
const QString &p_bodyContent,
|
|
|
@@ -989,6 +999,11 @@ bool VExporter::outputToHTMLFile(const QString &p_file,
|
|
|
qDebug() << "HTML files folder" << resFolderPath;
|
|
|
|
|
|
QString html(m_exportHtmlTemplate);
|
|
|
+ if (!p_title.isEmpty()) {
|
|
|
+ html.replace(HtmlHolder::c_headTitleHolder,
|
|
|
+ "<title>" + VUtils::escapeHtml(p_title) + "</title>");
|
|
|
+ }
|
|
|
+
|
|
|
if (!p_styleContent.isEmpty() && p_embedCssStyle) {
|
|
|
QString content(p_styleContent);
|
|
|
embedStyleResources(content);
|