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

Side by Side Diff: java/org/chromium/distiller/webdocument/WebTag.java

Issue 1230583006: Fix for keeping lists structure (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Classes were documented. Created 5 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 package org.chromium.distiller.webdocument;
2
3 /**
4 * This class represents HTML tags that need to be preserved over the
5 * distillation process.
6 */
7 public class WebTag extends WebElement {
8
9 private String tagName;
10 private TagType tagType;
11
12 public enum TagType {
13 START, END
14 }
15
16 public WebTag(String tagName, TagType tagType) {
17 this.tagName = tagName;
18 this.tagType = tagType;
19 }
20
21 public boolean isStartTag() {
22 return tagType == TagType.START;
23 }
24
25 public String getTagName() {
26 return tagName;
27 }
28
29 @Override
30 public String generateOutput(boolean textOnly) {
31 if (textOnly) {
32 return "";
33 }
34 return "<" + (isStartTag() ? "" : "/") + tagName + ">";
35 }
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698