added functionality to handle comment Node

bzr revid: nch@tinyerp.com-20090525064245-swbzaetxrmgm32zo
This commit is contained in:
Naresh Choksy
2009-05-25 12:12:45 +05:30
parent 9d9d50b539
commit 7561d80d6b
2 changed files with 8 additions and 0 deletions
+2
View File
@@ -12,6 +12,8 @@ class report(object):
_regex2 = re.compile("\[\[(.*?)(removeParentNode\(\s*(?:['\"](.*?)['\"])\s*\))(.*?)\]\]")
_regex3 = re.compile("\[\[\s*(.*?setTag\(\s*['\"](.*?)['\"]\s*,\s*['\"].*?['\"]\s*(?:,.*?)?\).*?)\s*\]\]")
for node in root_node:
if node.tag == etree.Comment:
continue
if node.text:
def _sub3(txt):
n = node
+6
View File
@@ -495,6 +495,9 @@ class _rml_flowable(object):
flow = []
for n in utils._child_get(td, self):
if n.tag == etree.Comment:
n.text = ''
continue
fl = self._flowable(n, extra_style=paraStyle)
if isinstance(fl,list):
flow += fl
@@ -676,6 +679,9 @@ class _rml_flowable(object):
def process_story(node_story):
sub_story = []
for node in utils._child_get(node_story, self):
if node.tag == etree.Comment:
node.text = ''
continue
flow = self._flowable(node)
if flow:
if isinstance(flow,list):