Skip to content

Commit

Permalink
more string escaping fixes per JuliaLang/julia#22800
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Aug 20, 2017
1 parent 8c8dd05 commit 0afbf08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/AWSAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ function pretty(v::Vector, dict, pad)
"\n$pad]"
end

pretty(s::String, args...) = string("\"", replace(s, "\$", "\\\$"), "\"")
function pretty(s::String, args...)
s = replace(s, "\$", "\\\$")

# Work around for https://github.com/JuliaLang/julia/pull/22800
s = replace(s, r"([^\\])\\([^ntrebfva\\'\"$`0-9])", s"\1\\\\\2")

return "\"$s\""
end


pretty(n, args...) = string(n)

Expand Down
2 changes: 1 addition & 1 deletion src/HTML2MD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function html2md(html)
md = String(post(URI("http://localhost:$tcp_port"), html).data)

# Work around for https://github.com/domchristie/to-markdown/issues/181
md = replace(md, "\\.", ".")
md = replace(md, r"([0-9])\\[.]", s"\1.")

return md
end
Expand Down

0 comments on commit 0afbf08

Please sign in to comment.