Skip to content

Commit

Permalink
Fix removeHtmlTag bug
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Sep 13, 2014
1 parent 41a65d9 commit 5467b71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/xiaoleilu/hutool/HtmlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static String removeHtmlTag(String content, boolean withTagContent, Strin
regex1 = StrUtil.format("(?i)<{}\\s?[^>]*?/>", tagName);
if(withTagContent) {
//标签及其包含内容
regex2 = StrUtil.format("(?i)<{}\\s*?[^>]*?>[^<]*?</{}>", tagName, tagName);
regex2 = StrUtil.format("(?i)(?s)<{}\\s*?[^>]*?>.*?</{}>", tagName, tagName);
}else {
//标签不包含内容
regex2 = StrUtil.format("(?i)<{}\\s*?[^>]*?>|</{}>", tagName, tagName);
Expand Down

0 comments on commit 5467b71

Please sign in to comment.