summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/TodoElement.java
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2011-10-02 17:07:55 +0200
committerDavid A. Madore <david+git@madore.org>2011-10-02 17:07:55 +0200
commit16f86e7bf5f22806c2a64f9a9bc501a2f13e72e5 (patch)
tree2c0953f87fd023dad6a61707b7d69dee2e6863bf /org/madore/damlengine/TodoElement.java
parent6e0587364ea813c1762a313feed942ff68e18e58 (diff)
downloaddamlengine-16f86e7bf5f22806c2a64f9a9bc501a2f13e72e5.tar.gz
damlengine-16f86e7bf5f22806c2a64f9a9bc501a2f13e72e5.tar.bz2
damlengine-16f86e7bf5f22806c2a64f9a9bc501a2f13e72e5.zip
Handle HTML <style> and <script> elements by adding CDATA sections as appropriate.
Previously, only the (automatically inserted) <style> and <script> elements in the HTML <head> were handled this way. This now extends to these elements anywhere in the document.
Diffstat (limited to 'org/madore/damlengine/TodoElement.java')
-rw-r--r--org/madore/damlengine/TodoElement.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/org/madore/damlengine/TodoElement.java b/org/madore/damlengine/TodoElement.java
index 12810c0..4f15afa 100644
--- a/org/madore/damlengine/TodoElement.java
+++ b/org/madore/damlengine/TodoElement.java
@@ -76,6 +76,12 @@ public abstract class TodoElement extends TodoItem {
protected final static Factory killAcronymFactory
= new TodoKillAcronymElement.Factory();
+ protected final static Factory styleFactory
+ = new TodoStyleOrScript.Factory(TodoStyleOrScript.Type.STYLE);
+
+ protected final static Factory scriptFactory
+ = new TodoStyleOrScript.Factory(TodoStyleOrScript.Type.SCRIPT);
+
protected final Element node;
public TodoElement(Element node,
@@ -97,6 +103,10 @@ public abstract class TodoElement extends TodoItem {
factory = killAFactory;
else if ( node.getLocalName().equals("acronym") )
factory = killAcronymFactory;
+ else if ( node.getLocalName().equals("style") )
+ factory = styleFactory;
+ else if ( node.getLocalName().equals("script") )
+ factory = scriptFactory;
}
if ( factory == null )
factory = defaultFactory;