个人技术分享

public static String htmltoString(String htmlContent) {
/*String htmlContent = "<p class=\"MsoNormal\"><span style=\"font-family: 思源黑体 CN Normal;\">1、应用场景</span></p>\n" +
"<p class=\"MsoNormal\"><span style=\"font-family: 思源黑体 CN Normal;\">登陆软件以后想要按照个人角色显示不同的首页内容,方便查看数据报表。</span></p>\n" +
"<p class=\"MsoNormal\"><span style=\"font-family: 思源黑体 CN Normal;\">2、功能实现</span></p>\n" +
"<p class=\"MsoNormal\"><span style=\"font-family: 思源黑体 CN Normal;\">导航入口:登陆软件点击顶部导航的</span><span style=\"font-family: 思源黑体 CN Normal;\">&ldquo;首页&rdquo;按钮,自动带出系统的默认首页。</span>" +
"<img id=\"1714118376743\" src=\"...\" data-id=\"...\"></p>\n" +
"<p class=\"MsoNormal\"><span style=\"font-family: 思源黑体 CN Normal;\">比如</span><span style=\"font-family: 思源黑体 CN Normal;\">&ldquo;舰长瞭望台&rdquo;想要将它设置成默认首页,先点击&ldquo;舰长瞭望台&rdquo;进入到界面中,勾选右侧&ldquo;默认首页&rdquo;选项。</span>" +
"<img id=\"1714118390015\" src=\"...\" data-id=\"...\"></p>\n" +
"<p class=\"MsoNormal\"><span style=\"font-family: 思源黑体 CN Normal;\">设置完成刷新一下软件,再次点击顶部导航的</span><span style=\"font-family: 思源黑体 CN Normal;\">&ldquo;首页&rdquo;按钮,将切换到&ldquo;舰长瞭望台&rdquo;界面。</span>" +
"<img id=\"1714118403814\" src=\"...\" data-id=\"...\"></p>";*/


Document doc = Jsoup.parse(htmlContent);
String text = doc.text();
System.out.println(text);
return text;
}