Skip to content

Commit

Permalink
Feat(save-html): beautify HTML/XML output (closes #750)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed May 17, 2016
1 parent a212e62 commit 41b9c45
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/ui/save-html.js
Expand Up @@ -3,8 +3,8 @@
// Saves content to HTML when asked to

define(
["core/utils"],
function (utils) {
["core/utils", "beautify-html", "core/beautify-options"],
function (utils, beautify, beautifyOpts) {
var msg, doc, conf;
var cleanup = function (rootEl) {
$(".removeOnSave", rootEl).remove();
Expand Down Expand Up @@ -154,7 +154,8 @@ define(
cleanup(rootEl);
str += rootEl.innerHTML;
str += "</html>";
return str;
var beautifulHTML = beautify.html_beautify(str, beautifyOpts);
return beautifulHTML;
}
// convert the document to XML, pass 5 as mode for XHTML5
, toXML: function (mode) {
Expand Down Expand Up @@ -239,7 +240,8 @@ define(
return out;
};
str += dumpNode(rootEl) + "</html>";
return str;
var beautifulXML = beautify.html_beautify(str, beautifyOpts);
return beautifulXML;
}
// create a diff marked version against the previousURI
// strategy - open a window in which there is a form with the
Expand Down

0 comments on commit 41b9c45

Please sign in to comment.