package com.doumee.core.utils;
|
|
import org.jsoup.Jsoup;
|
|
/**
|
* Created by IntelliJ IDEA.
|
*
|
* @Author : Rk
|
* @create 2026/1/20 16:58
|
*/
|
public class RichTextProcessor {
|
|
/**
|
* 从HTML中提取纯文本
|
*/
|
public static String extractPlainTextFromHtml(String htmlContent) {
|
if (htmlContent == null || htmlContent.isEmpty()) {
|
return "";
|
}
|
|
// 直接提取文本内容,去除所有HTML标签
|
return Jsoup.parse(htmlContent).text();
|
}
|
|
|
|
|
}
|