diff --git a/stdlib/REPL/src/docview.jl b/stdlib/REPL/src/docview.jl index cac5927ba6352..ca3996e19512b 100644 --- a/stdlib/REPL/src/docview.jl +++ b/stdlib/REPL/src/docview.jl @@ -338,9 +338,13 @@ function symbol_latex(s::String) return get(symbols_latex, s, "") end function repl_latex(io::IO, s::String) - # decompose NFC-normalized identifier to match tab-completion input - s = normalize(s, :NFD) latex = symbol_latex(s) + if isempty(latex) + # Decompose NFC-normalized identifier to match tab-completion + # input if the first search came up empty. + s = normalize(s, :NFD) + latex = symbol_latex(s) + end if !isempty(latex) print(io, "\"") printstyled(io, s, color=:cyan) diff --git a/test/docs.jl b/test/docs.jl index 465de47f026ad..50b36a9702838 100644 --- a/test/docs.jl +++ b/test/docs.jl @@ -1009,6 +1009,8 @@ end # issue #36378 (\u1e8b and x\u307 are the fully composed and decomposed forms of ẋ, respectively) @test sprint(repl_latex, "\u1e8b") == "\"x\u307\" can be typed by x\\dot\n\n" +# issue 39814 +@test sprint(repl_latex, "\u2209") == "\"\u2209\" can be typed by \\notin\n\n" # issue #15684 begin