Merge pull request #2541 from JuliaPlots/bbs/sani

special case LaTeXStrings in sanitation
This commit is contained in:
Simon Christ 2020-04-06 22:33:13 +02:00 committed by GitHub
commit ca653c5bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -901,6 +901,15 @@ function pgfx_sanitize_string(s::AbstractString)
s = replace(s, r"\\?\%" => "\\%") s = replace(s, r"\\?\%" => "\\%")
s = replace(s, r"\\?\_" => "\\_") s = replace(s, r"\\?\_" => "\\_")
s = replace(s, r"\\?\&" => "\\&") s = replace(s, r"\\?\&" => "\\&")
s = replace(s, r"\\?\{" => "\\{")
s = replace(s, r"\\?\}" => "\\}")
end
@require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" begin
using LaTeXStrings
function pgfx_sanitize_string(s::LaTeXString)
s = replace(s, r"\\?\#" => "\\#")
s = replace(s, r"\\?\%" => "\\%")
end
end end
function pgfx_sanitize_plot!(plt) function pgfx_sanitize_plot!(plt)
for (key, value) in plt.attr for (key, value) in plt.attr