cn.topicstudy.jutil.basic.text.html.HtmlUtil Maven / Gradle / Ivy
package cn.topicstudy.jutil.basic.text.html;
import cn.topicstudy.jutil.basic.text.StringUtil;
public class HtmlUtil {
/**
* 解析单层html标签
*
* @param singleLayerHtmlTag 例如:"), singleLayerHtmlTag.lastIndexOf("<"));
htmlTag.setText(text);
}
// attributeMap
// ") + 1);
String[] attrs = left.split("\\s");// \s匹配空白
for (String attr : attrs) {// 匹配不到时返回left,所以attrs一定非null
// attrs is:
//
if (!attr.contains("=")) continue;
String[] kv = attr.split("=");
String k = kv[0];
String v = kv[1];
htmlTag.getAttributeMap().put(k, v);
}
return htmlTag;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy