Index: java/org/chromium/distiller/webdocument/WebText.java |
diff --git a/java/org/chromium/distiller/webdocument/WebText.java b/java/org/chromium/distiller/webdocument/WebText.java |
index ae81ee6f97f2d9ca41ddfa00be521cf7646ab7bb..52f4eeea513695315f6f3223e74f94a423e21c0a 100644 |
--- a/java/org/chromium/distiller/webdocument/WebText.java |
+++ b/java/org/chromium/distiller/webdocument/WebText.java |
@@ -69,10 +69,16 @@ public class WebText extends WebElement { |
DomUtil.stripIds(clonedRoot); |
DomUtil.stripFontColorAttributes(clonedRoot); |
+ // Since LI Tag is being wrapped by a WebTag instance, |
wychen
2015/08/05 00:01:02
by a pair of |WebTag|s
Marcelo Correa
2015/08/05 00:26:35
You mean {@link WebTag}s or |WebTag|s?
wychen
2015/08/05 00:52:15
Oh. Should be {@link WebTag}s. Thanks for pointing
|
+ // We only need to get the innerHTML, otherwise |
wychen
2015/08/05 00:01:02
nit: we
|
+ // LI tag would be duplicated. |
+ Element elementClonedRoot = Element.as(clonedRoot); |
if (textOnly) { |
- return Element.as(clonedRoot).getInnerText(); |
+ return elementClonedRoot.getInnerText(); |
+ } else if (elementClonedRoot.getTagName().equals("LI")) { |
+ return elementClonedRoot.getInnerHTML(); |
} |
- return Element.as(clonedRoot).getString(); |
+ return elementClonedRoot.getString(); |
} |
public List<Node> getTextNodes() { |