From c3de59bc37a7a0d80827f0d56aee7c22b9eb49ff Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 23 Apr 2022 22:33:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmlns=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/me/ag2s/epublib/epub/ResourcesLoader.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/epublib/src/main/java/me/ag2s/epublib/epub/ResourcesLoader.java b/epublib/src/main/java/me/ag2s/epublib/epub/ResourcesLoader.java index 5da77b8d2..058299db2 100644 --- a/epublib/src/main/java/me/ag2s/epublib/epub/ResourcesLoader.java +++ b/epublib/src/main/java/me/ag2s/epublib/epub/ResourcesLoader.java @@ -74,7 +74,9 @@ public class ResourcesLoader { .createResource(zipEntry, zipFile.getInputStream(zipEntry)); /*掌上书苑有很多自制书OPF的nameSpace格式不标准,强制修复成正确的格式*/ if (href.endsWith("opf")) { - String string = new String(resource.getData()).replace("smlns=\"", "xmlns=\""); + String string = new String(resource.getData()) + .replace(" smlns=\"", " xmlns=\"") + .replace(" mlns=\"", " xmlns=\""); resource.setData(string.getBytes()); } @@ -135,7 +137,9 @@ public class ResourcesLoader { Resource resource = ResourceUtil.createResource(zipEntry, zipInputStream); ///*掌上书苑有很多自制书OPF的nameSpace格式不标准,强制修复成正确的格式*/ if (href.endsWith("opf")) { - String string = new String(resource.getData()).replace("smlns=\"", "xmlns=\""); + String string = new String(resource.getData()) + .replace(" smlns=\"", " xmlns=\"") + .replace(" mlns=\"", " xmlns=\""); resource.setData(string.getBytes()); } if (resource.getMediaType() == MediaTypes.XHTML) {