doum
10 小时以前 e68e324f91d1a4eb2d4c5f07d27ca105a308bc0c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();
    }
 
 
 
 
}