diff --git a/stdlib/REPL/src/docview.jl b/stdlib/REPL/src/docview.jl index 2e5fc361d8cbc..f4467b3e787bc 100644 --- a/stdlib/REPL/src/docview.jl +++ b/stdlib/REPL/src/docview.jl @@ -403,9 +403,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 05442df9d4cbe..41c3746d7476f 100644 --- a/test/docs.jl +++ b/test/docs.jl @@ -1271,6 +1271,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