Skip to content

Commit a27b04d

Browse files
authored
Merge pull request #32 from TimG1964/main
Update `escape()` to address issue #31
2 parents b6f934f + d5a761e commit a27b04d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/XML.jl

+1-1
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)