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

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

Issue 1230583006: Fix for keeping lists structure (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Fixed NestedElementRetainer.process method and unit tests 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.distiller.webdocument; 5 package org.chromium.distiller.webdocument;
6 6
7 import org.chromium.distiller.document.TextDocument; 7 import org.chromium.distiller.document.TextDocument;
8 import org.chromium.distiller.document.TextBlock; 8 import org.chromium.distiller.document.TextBlock;
9 9
10 import java.util.ArrayList; 10 import java.util.ArrayList;
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 public void addText(WebText text) { 24 public void addText(WebText text) {
25 elements.add(text); 25 elements.add(text);
26 } 26 }
27 27
28 public void addTable(WebTable table) { 28 public void addTable(WebTable table) {
29 elements.add(table); 29 elements.add(table);
30 } 30 }
31 31
32 public void addList(WebTag list) {
wychen 2015/08/05 00:01:02 addTag()?
33 elements.add(list);
34 }
35
32 public void addEmbed(WebElement embed) { 36 public void addEmbed(WebElement embed) {
33 elements.add(embed); 37 elements.add(embed);
34 } 38 }
35 39
36 public List<WebElement> getElements() { 40 public List<WebElement> getElements() {
37 return elements; 41 return elements;
38 } 42 }
39 43
40 public List<WebImage> getContentImages() { 44 public List<WebImage> getContentImages() {
41 List<WebImage> images = new ArrayList<>(); 45 List<WebImage> images = new ArrayList<>();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (!e.getIsContent()) continue; 101 if (!e.getIsContent()) continue;
98 output.append(e.generateOutput(textOnly)); 102 output.append(e.generateOutput(textOnly));
99 if (textOnly) { 103 if (textOnly) {
100 // Put some space between paragraphs in text-only mode. 104 // Put some space between paragraphs in text-only mode.
101 output.append("\n"); 105 output.append("\n");
102 } 106 }
103 } 107 }
104 return output.toString(); 108 return output.toString();
105 } 109 }
106 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698