Skip to content

Commit

Permalink
回复中的换行交给前端处理
Browse files Browse the repository at this point in the history
  • Loading branch information
时雨 committed May 7, 2015
1 parent d57d554 commit cb86d26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions static/assets/js/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ $(document).ready(function(){
//666666
txt = txt.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
txt = txt.replace(/@([a-zA-Z0-9_\-\u4e00-\u9fa5]+)/g, '<a href="/user/detail/$1">@$1</a>');
txt = txt.replace(/\n/g, "<br />");
$(this).html(txt);
});
(function(){
Expand Down
2 changes: 1 addition & 1 deletion util/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def intval(str):

def nl2br(str):
str = tornado.escape.xhtml_escape(str)
return str.replace("\n", "<br />")
return str

def dump(obj):
'''return a printable representation of an object for debugging'''
Expand Down

0 comments on commit cb86d26

Please sign in to comment.