File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from __future__ import absolute_import
9
9
10
+ import re
10
11
from lxml import etree
11
12
12
13
from .ns import NamespacePrefixedTag , nsmap
18
19
oxml_parser .set_element_class_lookup (element_class_lookup )
19
20
20
21
22
+ def remove_hyperlink_tags (xml ):
23
+ xml = xml .replace ("</w:hyperlink>" ,"" )
24
+ xml = re .sub ('<w:hyperlink[^>]*>' ,"" ,xml )
25
+ return xml
26
+
27
+
21
28
def parse_xml (xml ):
22
29
"""
23
30
Return root lxml element obtained by parsing XML character string in
24
31
*xml*, which can be either a Python 2.x string or unicode. The custom
25
32
parser is used, so custom element classes are produced for elements in
26
33
*xml* that have them.
27
34
"""
28
- root_element = etree .fromstring (xml , oxml_parser )
35
+ root_element = etree .fromstring (remove_hyperlink_tags ( xml ) , oxml_parser )
29
36
return root_element
30
37
31
38
You can’t perform that action at this time.
0 commit comments