Commit cdecc832 authored by strong's avatar strong

Merge branch 'bugfix_1019_comment_export'

parents 08dc1c10 4fc9b4b6
......@@ -1137,12 +1137,18 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
t_from_openId = thread.from?thread.from.uid:'',
t_praiseNames = thread.praiseNames,
t_praiseOpenIds = thread.praiseOpenIds;
var contentReplace = function(str){
return str.replace(/<[^>]+>/g,'').replace(/[&nbsp;,\n,\b,\t]/ig,'')
}
rows.push([
t_title,
t_time,
t_from,
t_from_openId,
thread.content,
contentReplace(thread.content),
thread.comment_count.toString(),
thread.share_count.toString(),
thread.praise_count.toString(),
......@@ -1156,7 +1162,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
time = date_format(comment.created),
openId = '',
nickName = '',
content = comment.content || '',
content = comment.content?contentReplace(comment.content) : '',
praiseCount = comment.praiseCount || 0,
praiseNames = '',
praiseOpenIds = '';
......@@ -1178,7 +1184,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
var time = date_format(sub_comment.created),
openId = '',
nickName = '',
content = sub_comment.content || '',
content = sub_comment.content?contentReplace(sub_comment.content) : '',
to = '';
if(sub_comment.from){
openId = sub_comment.from.uid || '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment