From f8d71f80092ed370a1662cc0da89f6cbfc3d7137 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Wed, 7 Apr 2021 00:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DfixPic=E4=B8=80=E6=AE=B5?= =?UTF-8?q?=E9=87=8C=E6=9C=89=E5=A4=9A=E4=B8=AAimg=E5=8F=AA=E4=BC=9A?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E7=AC=AC=E4=B8=80=E4=B8=AAimg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/ag2s/epublib/util/ResourceUtil.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java b/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java index b9425b4c8..7c021fae1 100644 --- a/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java +++ b/epublib/src/main/java/me/ag2s/epublib/util/ResourceUtil.java @@ -29,7 +29,8 @@ import me.ag2s.epublib.epub.EpubProcessorSupport; public class ResourceUtil { /** * 快速创建HTML类型的Resource - * @param title 章节的标题 + * + * @param title 章节的标题 * @param string 章节的正文 * @return 返回Resource */ @@ -42,9 +43,10 @@ public class ResourceUtil { /** * 快速创建HTML类型的Resource - * @param title 章节的标题 + * + * @param title 章节的标题 * @param string 章节的正文 - * @param href Resource的href + * @param href Resource的href * @return 返回Resource */ @@ -60,12 +62,14 @@ public class ResourceUtil { private static String createHtml(String title, String txt) { StringBuilder body = new StringBuilder(); for (String s : txt.split("\\r?\\n")) { - s=StringUtil.FixTrim(s); + s = StringUtil.FixTrim(s); if (s.length() != 0) { - if(s.contains("") - body.append(s);//.append(""); - }else { + body.append(s); + //.append(""); + } else { body.append("

").append(s).append("

"); } @@ -86,6 +90,7 @@ public class ResourceUtil { /** * 快速从File创建Resource + * * @param file File * @return Resource * @throws IOException IOException