mirror of
https://github.com/gedoor/legado.git
synced 2024-07-04 23:36:56 +08:00
优化
This commit is contained in:
parent
900bc3876c
commit
9009e32c87
|
@ -26,6 +26,7 @@ public class Resources implements Serializable {
|
|||
private static final long serialVersionUID = 2450876953383871451L;
|
||||
private static final String IMAGE_PREFIX = "image_";
|
||||
private static final String ITEM_PREFIX = "item_";
|
||||
private static final Pattern dataUriRegex = Pattern.compile("data:([\\w/\\-\\.]+);base64,(.*)");
|
||||
private int lastId = 1;
|
||||
|
||||
private Map<String, Resource> resources = new HashMap<>();
|
||||
|
@ -320,7 +321,6 @@ public class Resources implements Serializable {
|
|||
}
|
||||
href = StringUtil.substringBefore(href, Constants.FRAGMENT_SEPARATOR_CHAR);
|
||||
|
||||
Pattern dataUriRegex = Pattern.compile("data:([\\w/\\-\\.]+);base64,(.*)");
|
||||
Matcher dataUriMatcher = dataUriRegex.matcher(href);
|
||||
if (dataUriMatcher.find()) {
|
||||
String dataUriMediaTypeString = dataUriMatcher.group(1);
|
||||
|
|
|
@ -89,8 +89,7 @@ public class PackageDocumentReader extends PackageDocumentBase {
|
|||
for (int i = 0; i < originItemElements.getLength(); i++) {
|
||||
Element itemElement = (Element) originItemElements.item(i);
|
||||
fixedElements.add(itemElement);
|
||||
String href = DOMUtil
|
||||
.getAttribute(itemElement, NAMESPACE_OPF, OPFAttributes.href);
|
||||
String href = DOMUtil.getAttribute(itemElement, NAMESPACE_OPF, OPFAttributes.href);
|
||||
try {
|
||||
href = URLDecoder.decode(href, Constants.CHARACTER_ENCODING);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user