Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
015d832b
Commit
015d832b
authored
May 10, 2021
by
Eckhart Arnold
Browse files
lxml compatibilit of attributes can be ensured via configuration value
parent
8c7f14fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
DHParser/syntaxtree.py
View file @
015d832b
...
...
@@ -2011,9 +2011,10 @@ class Node: # (collections.abc.Sized): Base class omitted for cython-compatibil
if
src
==
''
and
not
(
node
.
has_attr
()
and
'_pos'
in
node
.
attr
)
and
node
.
_pos
>=
0
:
txt
.
append
(
' _pos="%i"'
%
node
.
_pos
)
if
root
and
id
(
node
)
in
root
.
error_nodes
and
not
node
.
has_attr
(
'err'
):
txt
.
append
(
' err="%s"'
%
(
''
.
join
(
str
(
err
).
replace
(
'"'
,
"'"
).
replace
(
'&'
,
'&'
).
replace
(
'<'
,
'<'
)
for
err
in
root
.
node_errors
(
node
))))
# txt.append(' err="%s"' % (
# ''.join(str(err).replace('"', "'").replace('&', '&').replace('<', '<')
# for err in root.node_errors(node))))
txt
.
append
(
' err='
+
(
attr_filter
(
''
.
join
(
str
(
err
))
for
err
in
root
.
node_errors
(
node
))))
if
node
.
tag_name
in
empty_tags
:
assert
not
node
.
result
,
(
"Node %s with content %s is not an empty element!"
%
(
node
.
tag_name
,
str
(
node
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment