Skip to content

Commit 9df29ff

Browse files
authored
Update escape() to address issue #31
1 parent b6f934f commit 9df29ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/XML.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function unescape(x::AbstractString)
2121
return result
2222
end
2323
function escape(x::String)
24-
result = replace(x, r"&(?=\s)" => "&")
24+
result = replace(x, r"&(?!amp;|quot;|apos;|gt;|lt;)" => "&")
2525
for (pat, r) in escape_chars[2:end]
2626
result = replace(result, pat => r)
2727
end

0 commit comments

Comments
 (0)