Merge branch 'fix/issue-77' into legacy/0.8

This commit is contained in:
Martin Zimmermann 2014-04-09 10:34:18 +02:00
commit 2a1ad60373
2 changed files with 8 additions and 2 deletions

View File

@ -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");

View File

@ -48,9 +48,15 @@ define(["app/markup"], function(Mark) {
return _.textContent.trim();
};
var detext = function(text) {
return text.replace(/\n\n/gi, '<br><div><br></div>')
.replace(/\n/gi, '<br>');
};
return {
cookie: cookie,
ago: ago,
text: text
text: text,
detext: detext
};
});