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) { ...@@ -1137,12 +1137,18 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
t_from_openId = thread.from?thread.from.uid:'', t_from_openId = thread.from?thread.from.uid:'',
t_praiseNames = thread.praiseNames, t_praiseNames = thread.praiseNames,
t_praiseOpenIds = thread.praiseOpenIds; t_praiseOpenIds = thread.praiseOpenIds;
var contentReplace = function(str){
return str.replace(/<[^>]+>/g,'').replace(/[&nbsp;,\n,\b,\t]/ig,'')
}
rows.push([ rows.push([
t_title, t_title,
t_time, t_time,
t_from, t_from,
t_from_openId, t_from_openId,
thread.content, contentReplace(thread.content),
thread.comment_count.toString(), thread.comment_count.toString(),
thread.share_count.toString(), thread.share_count.toString(),
thread.praise_count.toString(), thread.praise_count.toString(),
...@@ -1156,7 +1162,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) { ...@@ -1156,7 +1162,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
time = date_format(comment.created), time = date_format(comment.created),
openId = '', openId = '',
nickName = '', nickName = '',
content = comment.content || '', content = comment.content?contentReplace(comment.content) : '',
praiseCount = comment.praiseCount || 0, praiseCount = comment.praiseCount || 0,
praiseNames = '', praiseNames = '',
praiseOpenIds = ''; praiseOpenIds = '';
...@@ -1178,7 +1184,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) { ...@@ -1178,7 +1184,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
var time = date_format(sub_comment.created), var time = date_format(sub_comment.created),
openId = '', openId = '',
nickName = '', nickName = '',
content = sub_comment.content || '', content = sub_comment.content?contentReplace(sub_comment.content) : '',
to = ''; to = '';
if(sub_comment.from){ if(sub_comment.from){
openId = sub_comment.from.uid || ''; 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