Commit a667d83b authored by Van's avatar Van

Merge branch '3.6.5-dev' of https://github.com/b3log/solo into 3.6.5-dev

parents 09b5b88d 0bcfc1c6
......@@ -51,7 +51,7 @@ import java.util.stream.Collectors;
* Export service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.0, Jul 29, 2019
* @version 1.1.1.1, Sep 18, 2019
* @since 2.5.0
*/
@Service
......@@ -150,8 +150,8 @@ public class ExportService {
* Exports public articles to admin's GitHub repos. 博文定时同步 GitHub 仓库 https://hacpai.com/article/1557238327458
*/
public void exportGitHubRepo() {
LOGGER.log(Level.INFO, "Github repo syncing....");
try {
LOGGER.log(Level.INFO, "Github repo syncing....");
final JSONObject preference = optionQueryService.getPreference();
if (null == preference) {
return;
......@@ -265,6 +265,8 @@ public class ExportService {
LOGGER.info("Github repo sync completed: " + response.bodyText());
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Exports articles to github repo failed", e);
} finally {
LOGGER.log(Level.INFO, "Github repo synced");
}
}
......
......@@ -129,9 +129,13 @@ public final class Markdowns {
* @return html
*/
public static String clean(final String html) {
String ret = Jsoup.clean(html, Whitelist.relaxed().addAttributes("code", "class") /* 允许代码块语言高亮信息 */);
return ret;
final Whitelist whitelist = Whitelist.relaxed();
// 允许代码块语言高亮信息
whitelist.addAttributes("pre", "class").
addAttributes("div", "class").
addAttributes("span", "class").
addAttributes("code", "class");
return Jsoup.clean(html, whitelist);
}
/**
......
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