|
|
@ -29,6 +29,7 @@ import me.ag2s.epublib.epub.EpubProcessorSupport; |
|
|
|
public class ResourceUtil { |
|
|
|
public class ResourceUtil { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 快速创建HTML类型的Resource |
|
|
|
* 快速创建HTML类型的Resource |
|
|
|
|
|
|
|
* |
|
|
|
* @param title 章节的标题 |
|
|
|
* @param title 章节的标题 |
|
|
|
* @param string 章节的正文 |
|
|
|
* @param string 章节的正文 |
|
|
|
* @return 返回Resource |
|
|
|
* @return 返回Resource |
|
|
@ -42,6 +43,7 @@ public class ResourceUtil { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 快速创建HTML类型的Resource |
|
|
|
* 快速创建HTML类型的Resource |
|
|
|
|
|
|
|
* |
|
|
|
* @param title 章节的标题 |
|
|
|
* @param title 章节的标题 |
|
|
|
* @param string 章节的正文 |
|
|
|
* @param string 章节的正文 |
|
|
|
* @param href Resource的href |
|
|
|
* @param href Resource的href |
|
|
@ -63,8 +65,10 @@ public class ResourceUtil { |
|
|
|
s = StringUtil.FixTrim(s); |
|
|
|
s = StringUtil.FixTrim(s); |
|
|
|
if (s.length() != 0) { |
|
|
|
if (s.length() != 0) { |
|
|
|
if (s.contains("<img")) { |
|
|
|
if (s.contains("<img")) { |
|
|
|
|
|
|
|
//加上div的话多看能点看大图,但掌阅的图会因为排版变得非常小。
|
|
|
|
//body.append("<div class=\"duokan-image-single img-note\">")
|
|
|
|
//body.append("<div class=\"duokan-image-single img-note\">")
|
|
|
|
body.append(s);//.append("</div>");
|
|
|
|
body.append(s); |
|
|
|
|
|
|
|
//.append("</div>");
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
body.append("<p>").append(s).append("</p>"); |
|
|
|
body.append("<p>").append(s).append("</p>"); |
|
|
|
} |
|
|
|
} |
|
|
@ -86,6 +90,7 @@ public class ResourceUtil { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 快速从File创建Resource |
|
|
|
* 快速从File创建Resource |
|
|
|
|
|
|
|
* |
|
|
|
* @param file File |
|
|
|
* @param file File |
|
|
|
* @return Resource |
|
|
|
* @return Resource |
|
|
|
* @throws IOException IOException |
|
|
|
* @throws IOException IOException |
|
|
|