Adding comments.
This commit is contained in:
parent
92b51a0f35
commit
3a0aca3b7b
1 changed files with 5 additions and 1 deletions
|
|
@ -242,7 +242,7 @@ def markdown_filter(markdown_text):
|
|||
Convert a markdown text into a ODT formated text
|
||||
"""
|
||||
|
||||
from copy import deepcopy, copy
|
||||
from copy import deepcopy
|
||||
from xml.dom import Node
|
||||
|
||||
try:
|
||||
|
|
@ -285,6 +285,10 @@ def markdown_filter(markdown_text):
|
|||
if html_node.hasChildNodes():
|
||||
for child_node in html_node.childNodes:
|
||||
|
||||
# We use different methods to clone the childs
|
||||
# because 'deepcopy' duplicates TEXT_NODE nodes
|
||||
# inside a ELEMENT_NODE Node, and because
|
||||
# 'cloneNode' does not work with TEXT_NODE nodes.
|
||||
if child_node.nodeType == Node.ELEMENT_NODE:
|
||||
odt_node.appendChild(child_node.cloneNode(True))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue