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

Unified Diff: boilerpipe-core/src/main/de/l3s/boilerpipe/sax/CommonTagActions.java

Issue 296113004: Start using computed style instead of default tag actions. (Closed) Base URL: https://code.google.com/p/dom-distiller/@master
Patch Set: Added tests Created 6 years, 7 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: boilerpipe-core/src/main/de/l3s/boilerpipe/sax/CommonTagActions.java
diff --git a/boilerpipe-core/src/main/de/l3s/boilerpipe/sax/CommonTagActions.java b/boilerpipe-core/src/main/de/l3s/boilerpipe/sax/CommonTagActions.java
index 123031e6293ccf61bd31e9cc56d9b6c11c04fd11..8aa98e9e31390b26b656b3659464b7de8d2662da 100644
--- a/boilerpipe-core/src/main/de/l3s/boilerpipe/sax/CommonTagActions.java
+++ b/boilerpipe-core/src/main/de/l3s/boilerpipe/sax/CommonTagActions.java
@@ -209,7 +209,7 @@ public abstract class CommonTagActions {
};
private static final Pattern PAT_FONT_SIZE = Pattern
.compile("([\\+\\-]?)([0-9])");
-
+
/**
* Explicitly marks this tag a simple "block-level" element, which always generates whitespace
*/
@@ -225,12 +225,33 @@ public abstract class CommonTagActions {
final String localName, final String qName) {
return true;
}
-
+
public boolean changesTagLevel() {
return true;
}
- };
-
+ };
+
+ /**
+ * Explicitly marks this tag an inline-block element, which does not generate whitespace.
+ */
+ public static final TagAction TA_INLINE_BLOCK_LEVEL = new TagAction() {
+
+ public boolean start(BoilerpipeHTMLContentHandler instance,
+ final String localName, final String qName,
+ final Attributes atts) {
+ return false;
+ }
+
+ public boolean end(BoilerpipeHTMLContentHandler instance,
+ final String localName, final String qName) {
+ return false;
+ }
+
+ public boolean changesTagLevel() {
+ return true;
+ }
+ };
+
/**
* Special TagAction for the <code>&lt;FONT&gt;</code> tag, which keeps track of the
* absolute and relative font size.

Powered by Google App Engine
This is Rietveld 408576698