MCPcopy Create free account
hub / github.com/0opslab/opslabJutil / html

Method html

src/main/java/com/opslab/helper/WebHelper.java:83–94  ·  view source on GitHub ↗

html转实体 @param content @return

(String content)

Source from the content-addressed store, hash-verified

81 * @return
82 */
83 public static String html(String content) {
84 if (StringUtil.isEmpty(content)) {
85 return "";
86 }
87 String html = content;
88 html = html.replaceAll("'", "'");
89 html = html.replaceAll(""", "\"");
90 html = html.replaceAll(" ", " ");
91 html = html.replaceAll("&lt;", "<");
92 html = html.replaceAll("&gt;", ">");
93 return html;
94 }
95
96 /**
97 * 去除待带script、src的语句,转义替换后的value值

Callers 1

testhtmlMethod · 0.95

Calls 1

isEmptyMethod · 0.95

Tested by 1

testhtmlMethod · 0.76