Put <title> and <base> in the <head> instead of <body>

This also means renderHTML() is no longer needed.
This commit is contained in:
Nate Weaver
2020-01-30 06:10:45 -06:00
parent dc4850b777
commit 447cc44b8e
6 changed files with 28 additions and 24 deletions

View File

@@ -437,6 +437,8 @@ extension WebViewController: UIScrollViewDelegate {
private struct TemplateData: Codable {
let style: String
let body: String
let title: String
let baseURL: String
}
private struct ImageClickMessage: Codable {
@@ -478,7 +480,7 @@ private extension WebViewController {
rendering = ArticleRenderer.noSelectionHTML(style: style)
}
let templateData = TemplateData(style: rendering.style, body: rendering.html)
let templateData = TemplateData(style: rendering.style, body: rendering.html, title: rendering.title, baseURL: rendering.baseURL)
let encoder = JSONEncoder()
var render = "error();"