Commit af2a5828 authored by Liang Ding's avatar Liang Ding

EH - 历史评论数据 MD 解析

parent ec511c6f
...@@ -40,6 +40,7 @@ import org.b3log.solo.repository.ArticleRepository; ...@@ -40,6 +40,7 @@ import org.b3log.solo.repository.ArticleRepository;
import org.b3log.solo.repository.CommentRepository; import org.b3log.solo.repository.CommentRepository;
import org.b3log.solo.repository.PageRepository; import org.b3log.solo.repository.PageRepository;
import org.b3log.solo.util.Emotions; import org.b3log.solo.util.Emotions;
import org.b3log.solo.util.Markdowns;
import org.b3log.solo.util.Thumbnails; import org.b3log.solo.util.Thumbnails;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
...@@ -48,7 +49,7 @@ import org.json.JSONObject; ...@@ -48,7 +49,7 @@ import org.json.JSONObject;
* Comment query service. * Comment query service.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.0.8, May 10, 2016 * @version 1.3.0.8, Jun 28, 2016
* @since 0.3.5 * @since 0.3.5
*/ */
@Service @Service
...@@ -193,6 +194,7 @@ public class CommentQueryService { ...@@ -193,6 +194,7 @@ public class CommentQueryService {
String commentContent = comment.optString(Comment.COMMENT_CONTENT); String commentContent = comment.optString(Comment.COMMENT_CONTENT);
commentContent = Emotions.convert(commentContent); commentContent = Emotions.convert(commentContent);
commentContent = Markdowns.toHTML(commentContent);
comment.put(Comment.COMMENT_CONTENT, commentContent); comment.put(Comment.COMMENT_CONTENT, commentContent);
comment.put(Comment.COMMENT_TIME, ((Date) comment.get(Comment.COMMENT_DATE)).getTime()); comment.put(Comment.COMMENT_TIME, ((Date) comment.get(Comment.COMMENT_DATE)).getTime());
...@@ -251,6 +253,7 @@ public class CommentQueryService { ...@@ -251,6 +253,7 @@ public class CommentQueryService {
String commentContent = comment.optString(Comment.COMMENT_CONTENT); String commentContent = comment.optString(Comment.COMMENT_CONTENT);
commentContent = Emotions.convert(commentContent); commentContent = Emotions.convert(commentContent);
commentContent = Markdowns.toHTML(commentContent);
comment.put(Comment.COMMENT_CONTENT, commentContent); comment.put(Comment.COMMENT_CONTENT, commentContent);
ret.add(comment); ret.add(comment);
......
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