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

Unified Diff: java/org/chromium/distiller/webdocument/PlaceHolder.java

Issue 1230583006: Fix for keeping lists structure (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Small code refactor for more appropriate names. Created 5 years, 5 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/webdocument/PlaceHolder.java
diff --git a/java/org/chromium/distiller/webdocument/PlaceHolder.java b/java/org/chromium/distiller/webdocument/PlaceHolder.java
new file mode 100644
index 0000000000000000000000000000000000000000..c1b66a25576937a2cfe72fff81147adb77a33c08
--- /dev/null
+++ b/java/org/chromium/distiller/webdocument/PlaceHolder.java
@@ -0,0 +1,37 @@
+package org.chromium.distiller.webdocument;
+
+public class PlaceHolder extends WebElement {
wychen 2015/08/01 01:00:20 Might need a more specific name, but not too speci
+
+ private String tagName;
+ private TagType tagType;
+
+ public enum TagType {
+ START, END
+ }
+
+ public PlaceHolder(String tagName, TagType tagType) {
+ this.tagName = tagName;
+ this.tagType = tagType;
+ }
+
+ public boolean isStart() {
+ return tagType == TagType.START;
+ }
+
+ public String getTagName() {
+ return tagName;
+ }
+
+ @Override
+ public String generateOutput(boolean textOnly) {
+ if (textOnly) {
+ return "";
+ }
+ StringBuilder sb = new StringBuilder("<");
+ if (!isStart()) {
+ sb.append("/");
+ }
+ sb.append(tagName.toLowerCase()).append(">");
+ return sb.toString();
mdjones 2015/08/03 16:57:54 I think the following is more clear: return "<" +
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698