mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-25 00:00:52 -04:00
Escape illegal characters in XML (#82)
This commit is contained in:
+10
@@ -154,3 +154,13 @@ def ctime(file_path : String) : Time
|
||||
Time.new stat.st_ctim, Time::Location::UTC
|
||||
{% end %}
|
||||
end
|
||||
|
||||
def escape_xml(str)
|
||||
str.gsub({
|
||||
'>' => ">",
|
||||
'<' => "<",
|
||||
'"' => """,
|
||||
'\'' => "'",
|
||||
'&' => "&",
|
||||
})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user