mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-25 15:37:56 +01:00
Fix SVG export tests...
This commit is contained in:
parent
202c3f28a3
commit
b6ee7e61b8
4
pom.xml
4
pom.xml
@ -105,8 +105,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -140,9 +140,7 @@ public class ExporterFactory {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilder documentBuilder = factory.newDocumentBuilder();
|
||||
|
||||
if (!svgXml.trim().startsWith("<svg xmlns=\"http://www.w3.org/2000/svg\"")) {
|
||||
svgXml = svgXml.replaceFirst("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ");
|
||||
} else {
|
||||
if (!svgXml.contains("xmlns:xlink=\"http://www.w3.org/1999/xlink\"")) {
|
||||
svgXml = svgXml.replaceFirst("<svg ", "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" ");
|
||||
}
|
||||
|
||||
@ -222,8 +220,9 @@ public class ExporterFactory {
|
||||
|
||||
Element elem = (Element) node;
|
||||
|
||||
// Cook image href ...
|
||||
// If the image is a external URL, embeed it...
|
||||
String imgUrl = elem.getAttribute("href");
|
||||
if (!imgUrl.startsWith("image/png;base64") ||!imgUrl.startsWith("data:image/png;base64") ) {
|
||||
elem.removeAttribute("href");
|
||||
|
||||
if (imgUrl == null || imgUrl.isEmpty()) {
|
||||
@ -250,6 +249,7 @@ public class ExporterFactory {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private File iconFile(@NotNull final String imgUrl) throws IOException {
|
||||
int index = imgUrl.lastIndexOf("/");
|
||||
|
Loading…
Reference in New Issue
Block a user