Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: size和colspan解析错误 #166

Merged
merged 2 commits into from
Jul 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ public String decode(String content, HtmlData htmlData) {


content = StringUtils.replaceAll(content, ignoreCaseTag
+ "\\[td\\scolspan=(\\d+)\\]",
+ "\\[td\\scolspan=?(\\d+)\\]",
"<td colspan='$1' style='border-left:1px solid #aaa;border-bottom:1px solid #aaa'>");
content = StringUtils.replaceAll(content, ignoreCaseTag
+ "\\[td\\srowspan=(\\d+)\\]",
+ "\\[td\\srowspan=?(\\d+)\\]",
"<td rowspan='$1' style='border-left:1px solid #aaa;border-bottom:1px solid #aaa;'>");
content = StringUtils.replaceAll(content, "\\[td\\]", "<td style='border-left:1px solid #aaa;border-bottom:1px solid #aaa;'>");
content = StringUtils.replaceAll(content, "\\[/td\\]", "</td>");
Expand All @@ -211,7 +211,7 @@ public String decode(String content, HtmlData htmlData) {
content = StringUtils.replaceAll(content, ignoreCaseTag + "\\[/font\\]", "</span>");

// size
content = StringUtils.replaceAll(content, ignoreCaseTag + "\\[size=(\\d+)%\\]",
content = StringUtils.replaceAll(content, ignoreCaseTag + "\\[size=(\\d+)%?\\]",
"<span style=\"font-size:$1%;line-height:$1%\">");
content = StringUtils.replaceAll(content, ignoreCaseTag + "\\[/size\\]", "</span>");

Expand Down