diff --git a/js/ui/save-html.js b/js/ui/save-html.js index 772e1cbc8a..319bb269ae 100644 --- a/js/ui/save-html.js +++ b/js/ui/save-html.js @@ -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(); @@ -154,7 +154,8 @@ define( cleanup(rootEl); str += rootEl.innerHTML; str += ""; - 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) { @@ -239,7 +240,8 @@ define( return out; }; str += dumpNode(rootEl) + ""; - 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