package com.ruoyi.web.modules.content.support;

import com.ruoyi.common.utils.StringUtils;

/**
 * 入驻协议富文本内容校验
 */
public final class AgreementContentSupport
{
    private AgreementContentSupport()
    {
    }

    /**
     * 去 HTML 标签后是否为空（含仅空白、&nbsp;）
     */
    public static boolean isBlankHtml(String html)
    {
        if (StringUtils.isEmpty(html))
        {
            return true;
        }
        String text = html.replaceAll("<[^>]+>", "");
        text = text.replace("&nbsp;", " ").replace("\u00A0", " ");
        return StringUtils.isEmpty(text.trim());
    }
}
