fix the mess of encodings
This commit is contained in:
parent
3d91ebbbd7
commit
9950188e0d
|
@ -18,6 +18,7 @@ dependencies {
|
||||||
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.5'
|
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.5'
|
||||||
implementation group: 'org.json', name: 'json', version: '20240303'
|
implementation group: 'org.json', name: 'json', version: '20240303'
|
||||||
implementation group: 'io.github.java-diff-utils', name: 'java-diff-utils', version: '4.12'
|
implementation group: 'io.github.java-diff-utils', name: 'java-diff-utils', version: '4.12'
|
||||||
|
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.12.0'
|
||||||
|
|
||||||
implementation 'com.jetbrains.intellij.java:java-gui-forms-rt:203.7148.30'
|
implementation 'com.jetbrains.intellij.java:java-gui-forms-rt:203.7148.30'
|
||||||
antTask 'com.jetbrains.intellij.java:java-compiler-ant-tasks:203.7148.30'
|
antTask 'com.jetbrains.intellij.java:java-compiler-ant-tasks:203.7148.30'
|
||||||
|
@ -35,6 +36,7 @@ jar {
|
||||||
'Main-Class': 'Main'
|
'Main-Class': 'Main'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
from {
|
from {
|
||||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
|
|
||||||
public class Rizzo {
|
public class Rizzo {
|
||||||
private Scanner scanner;
|
private Scanner scanner;
|
||||||
|
@ -123,15 +124,7 @@ public class Rizzo {
|
||||||
transformer.setOutputProperty(OutputKeys.METHOD, "html");
|
transformer.setOutputProperty(OutputKeys.METHOD, "html");
|
||||||
transformer.transform(source, result);
|
transformer.transform(source, result);
|
||||||
// Look ma, I'm breaking XML standards!
|
// Look ma, I'm breaking XML standards!
|
||||||
String xmlString = result.getWriter().toString()
|
String xmlString = StringEscapeUtils.unescapeHtml4(result.getWriter().toString());
|
||||||
.replace("&", "&")
|
|
||||||
.replace("<", "<")
|
|
||||||
.replace(">", ">")
|
|
||||||
.replace("	", "\t")
|
|
||||||
.replace("", "\b")
|
|
||||||
.replace(" ", "\n")
|
|
||||||
.replace(" ", "\r")
|
|
||||||
.replace("", "\f");
|
|
||||||
try (PrintStream ps = new PrintStream(output)) {
|
try (PrintStream ps = new PrintStream(output)) {
|
||||||
ps.print(xmlString);
|
ps.print(xmlString);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user