Skip to content

Commit

Permalink
Use zero-width space when accounting for single-letter strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobjpeters committed Oct 26, 2024
1 parent ef892f4 commit 6f3a235
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Strings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ show_typst(io, x::AbstractMatrix) = mode(io) == code ?
print(io, "\n", indent ^ depth, ")")
end, IOContext(io, :parenthesize => false), x; indent = indent(io), depth = depth(io))
show_typst(io, x::AbstractString) = enclose((io, x) -> escape_string(io, x, "\""),
io, x, "\"", mode(io) == math && length(x) == 1 ? " \"" : "\"")
io, x, "\"", mode(io) == math && length(x) == 1 ? "\\u{200b}\"" : "\"")
show_typst(io, x::Bool) = mode(io) == math ? enclose(print, io, x, "\"") : print(io, x)
show_typst(io, x::Complex{Bool}) = _show_typst(io, Complex(Int(real(x)), Int(imag(x))))
show_typst(io, x::Complex) = math_mode(io, x) do io, x
Expand Down

0 comments on commit 6f3a235

Please sign in to comment.