Skip to content

Commit

Permalink
try to support LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Jul 13, 2023
1 parent 1702e22 commit 4fcaf50
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Cobweb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,15 @@ _h(x::Symbol) = x in HTML5_TAGS ? Expr(:., :(Cobweb.h), QuoteNode(x)) : x

#-----------------------------------------------------------------------------# escape
escape_chars = ['&' => "&amp;", '"' => "&quot;", ''' => "&#39;", '<' => "&lt;", '>' => "&gt;"]
escape(x) = replace(string(x), escape_chars...)
unescape(x::AbstractString) = replace(x, reverse.(escape_chars)...)

function escape(x; patterns = escape_chars)
for pat in patterns
x = replace(x, pat)
end
return x
end

unescape(x::AbstractString) = escape(x; patterns = reverse.(escape_chars))

#-----------------------------------------------------------------------------# show (html)
function print_opening_tag(io::IO, o::Node; self_close::Bool = false)
Expand Down

0 comments on commit 4fcaf50

Please sign in to comment.