diff --git a/isso/js/app/isso.js b/isso/js/app/isso.js index 580cceb..0bec02e 100644 --- a/isso/js/app/isso.js +++ b/isso/js/app/isso.js @@ -194,7 +194,7 @@ define(["app/text/html", "app/dom", "app/utils", "app/config", "app/api", "app/m api.view(comment.id, 1).then(function(rv) { var textarea = lib.editorify($.new("div.textarea")); - textarea.textContent = rv.text; + textarea.innerHTML = utils.detext(rv.text); textarea.focus(); text.classList.remove("text"); diff --git a/isso/js/app/utils.js b/isso/js/app/utils.js index 4cf56cb..a7bbe59 100644 --- a/isso/js/app/utils.js +++ b/isso/js/app/utils.js @@ -48,9 +48,15 @@ define(["app/markup"], function(Mark) { return _.textContent.trim(); }; + var detext = function(text) { + return text.replace(/\n\n/gi, '

') + .replace(/\n/gi, '
'); + }; + return { cookie: cookie, ago: ago, - text: text + text: text, + detext: detext }; });