Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: java/org/chromium/distiller/DomUtil.java

Issue 2020403002: Add support for figure element (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: comments addressed Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: java/org/chromium/distiller/DomUtil.java
diff --git a/java/org/chromium/distiller/DomUtil.java b/java/org/chromium/distiller/DomUtil.java
index 28ec2aca7f8a816f7a8f7fc5e50d6cb563793959..ca00199403eeab74eb628fd2ec3acf0f456da9d6 100644
--- a/java/org/chromium/distiller/DomUtil.java
+++ b/java/org/chromium/distiller/DomUtil.java
@@ -451,6 +451,15 @@ public class DomUtil {
return 0;
}
+ public static String escapeHTML(String string) {
+ return string.replaceAll("&", "&")
+ .replaceAll("<", "&lt;")
+ .replaceAll(">", "&gt;")
+ .replaceAll("\"", "&quot;")
+ .replaceAll("'", "&#039;")
+ .replaceAll("/", "&#x2F;");
+ }
+
/**
* Generate HTML/text output for a given node tree/subtree. This will ignore hidden
* elements.

Powered by Google App Engine
This is Rietveld 408576698