Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Escape replacements in export-html.js (closes #211)
Browse files Browse the repository at this point in the history
  • Loading branch information
brrd committed Dec 12, 2017
1 parent 7519dad commit 11e7786
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/renderer/export-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ function exportHtml (abrDoc, templateName, destPath, callback) {
files.readFile(pathModule.join(templatePath, "/template.html"), function (template) {
// Process templating
var defaultTitle = abrDoc.localizer.get("html-export-title"),
page = template.replace(/\$DOCUMENT_TITLE/g, getDocTitle(markdown, defaultTitle))
.replace(/\$DOCUMENT_CONTENT/g, htmlContent)
.replace(/\$ASSETS_PATH/g, "./" + parsePath(destPath).basename + "_files");
docTitle = getDocTitle(markdown, defaultTitle),
assetsPath = "./" + parsePath(destPath).basename + "_files",
page = template.replace(/\$DOCUMENT_TITLE/g, function () { return docTitle; })
.replace(/\$DOCUMENT_CONTENT/g, function () { return htmlContent; })
.replace(/\$ASSETS_PATH/g, function () { return assetsPath; });
// Write output file
files.writeFile(page, destPath, function (err) {
if (err) {
Expand Down

0 comments on commit 11e7786

Please sign in to comment.