diff options
Diffstat (limited to 'org/madore/damlengine/TodoCommentsScript.java')
-rw-r--r-- | org/madore/damlengine/TodoCommentsScript.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/org/madore/damlengine/TodoCommentsScript.java b/org/madore/damlengine/TodoCommentsScript.java index 224d547..eb250e8 100644 --- a/org/madore/damlengine/TodoCommentsScript.java +++ b/org/madore/damlengine/TodoCommentsScript.java @@ -1,5 +1,6 @@ package org.madore.damlengine; +import java.util.regex.Pattern; import org.w3c.dom.*; public final class TodoCommentsScript extends TodoElement { @@ -13,6 +14,11 @@ public final class TodoCommentsScript extends TodoElement { @Override public void handle() { if ( ctx.gc.commentsJSParam == null ) { + Node ws = node.getNextSibling(); + if ( ( ws.getNodeType() == Node.TEXT_NODE + || ws.getNodeType() == Node.CDATA_SECTION_NODE ) + && Pattern.matches("^\\s*$",((CharacterData)ws).getData()) ) + node.getParentNode().removeChild(ws); node.getParentNode().removeChild(node); return; } |