added functionality to handle comment Node and support for font tag and its attributes (ref:nch)
bzr revid: hda@hda-20090525065901-7943qtd1q9x1u9vb
This commit is contained in:
commit
47d9e9dda3
|
@ -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
|
||||
|
|
|
@ -446,9 +446,14 @@ class _rml_flowable(object):
|
|||
def _textual(self, node):
|
||||
rc1 = utils._process_text(self, node.text or '')
|
||||
for n in utils._child_get(node,self):
|
||||
rc1 += '<'+n.tag+'>'
|
||||
rc1 += self._textual(n)
|
||||
rc1 += '</'+n.tag+'>'
|
||||
txt_n = copy.deepcopy(n)
|
||||
for key in txt_n.attrib.keys():
|
||||
if key in ('rml_except', 'rml_loop', 'rml_tag'):
|
||||
del txt_n.attrib[key]
|
||||
if not self._textual(n).isspace():
|
||||
txt_n.text = self._textual(n)
|
||||
txt_n.tail = ''
|
||||
rc1 += etree.tostring(txt_n)
|
||||
rc1 += utils._process_text(self, node.tail or '')
|
||||
return rc1
|
||||
|
||||
|
@ -490,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
|
||||
|
@ -674,6 +682,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):
|
||||
|
|
Loading…
Reference in New Issue