Commit 9e62a03a authored by Liang Ding's avatar Liang Ding

🎨 #12787 改进 Emoji 处理过程

parent d15224d5
......@@ -43,7 +43,6 @@ import org.b3log.solo.event.EventTypes;
import org.b3log.solo.model.*;
import org.b3log.solo.processor.console.ConsoleRenderer;
import org.b3log.solo.service.*;
import org.b3log.solo.util.Emotions;
import org.b3log.solo.util.Markdowns;
import org.b3log.solo.util.Skins;
import org.b3log.solo.util.Solos;
......@@ -170,8 +169,7 @@ public class ArticleProcessor {
}
try {
String html = Emotions.convert(markdownText);
html = Markdowns.toHTML(html);
final String html = Markdowns.toHTML(markdownText);
result.put(Common.DATA, html);
} catch (final Exception e) {
LOGGER.log(Level.ERROR, e.getMessage(), e);
......
......@@ -883,7 +883,6 @@ public class ArticleQueryService {
// Markdown to HTML for content and abstract
Stopwatchs.start("Get Article Content [Markdown]");
String content = article.optString(Article.ARTICLE_CONTENT);
content = Emotions.convert(content);
content = Markdowns.toHTML(content);
article.put(Article.ARTICLE_CONTENT, content);
Stopwatchs.end();
......@@ -917,14 +916,12 @@ public class ArticleQueryService {
Stopwatchs.start("Markdown Article [id=" + article.optString(Keys.OBJECT_ID) + "]");
String content = article.optString(Article.ARTICLE_CONTENT);
content = Emotions.convert(content);
content = Markdowns.toHTML(content);
article.put(Article.ARTICLE_CONTENT, content);
String abstractContent = article.optString(Article.ARTICLE_ABSTRACT);
if (StringUtils.isNotBlank(abstractContent)) {
Stopwatchs.start("Abstract");
abstractContent = Emotions.convert(abstractContent);
abstractContent = Markdowns.toHTML(abstractContent);
article.put(Article.ARTICLE_ABSTRACT, abstractContent);
Stopwatchs.end();
......
......@@ -284,8 +284,7 @@ public class CommentMgmtService {
ret.put(Common.COMMENTABLE, preference.getBoolean(Option.ID_C_COMMENTABLE) && article.getBoolean(Article.ARTICLE_COMMENTABLE));
ret.put(Common.PERMALINK, article.getString(Article.ARTICLE_PERMALINK));
ret.put(Comment.COMMENT_NAME, commentName);
String cmtContent = Emotions.convert(commentContent);
cmtContent = Markdowns.toHTML(cmtContent);
String cmtContent = Markdowns.toHTML(commentContent);
cmtContent = Markdowns.clean(cmtContent);
ret.put(Comment.COMMENT_CONTENT, cmtContent);
ret.put(Comment.COMMENT_URL, commentURL);
......
......@@ -186,7 +186,6 @@ public class CommentQueryService {
comment.put(Common.COMMENT_TITLE, title);
String commentContent = comment.optString(Comment.COMMENT_CONTENT);
commentContent = Emotions.convert(commentContent);
commentContent = Markdowns.toHTML(commentContent);
commentContent = Markdowns.clean(commentContent);
comment.put(Comment.COMMENT_CONTENT, commentContent);
......@@ -246,7 +245,6 @@ public class CommentQueryService {
}
String commentContent = comment.optString(Comment.COMMENT_CONTENT);
commentContent = Emotions.convert(commentContent);
commentContent = Markdowns.toHTML(commentContent);
commentContent = Markdowns.clean(commentContent);
comment.put(Comment.COMMENT_CONTENT, commentContent);
......
......@@ -516,7 +516,6 @@ public class DataModelService {
final List<JSONObject> recentComments = commentRepository.getRecentComments(recentCommentDisplayCnt);
for (final JSONObject comment : recentComments) {
String commentContent = comment.optString(Comment.COMMENT_CONTENT);
commentContent = Emotions.convert(commentContent);
commentContent = Markdowns.toHTML(commentContent);
commentContent = Jsoup.clean(commentContent, Whitelist.relaxed());
comment.put(Comment.COMMENT_CONTENT, commentContent);
......
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