diff --git a/stdlib/REPL/src/docview.jl b/stdlib/REPL/src/docview.jl index b6eb73bcd5faa..2e5fc361d8cbc 100644 --- a/stdlib/REPL/src/docview.jl +++ b/stdlib/REPL/src/docview.jl @@ -221,7 +221,7 @@ function lookup_doc(ex) str = string(ex) isdotted = startswith(str, ".") if endswith(str, "=") && Base.operator_precedence(ex) == Base.prec_assignment && ex !== :(:=) - op = str[1:end-1] + op = chop(str) eq = isdotted ? ".=" : "=" return Markdown.parse("`x $op= y` is a synonym for `x $eq x $op y`") elseif isdotted && ex !== :(..) diff --git a/stdlib/REPL/test/docview.jl b/stdlib/REPL/test/docview.jl index 1cc5037c1c806..160544eb475d2 100644 --- a/stdlib/REPL/test/docview.jl +++ b/stdlib/REPL/test/docview.jl @@ -47,3 +47,7 @@ end # shouldn't throw when there is a space in a middle of query @test (REPL.matchinds("a ", "a file.txt"); true) end + +@testset "Unicode doc lookup (#41589)" begin + @test REPL.lookup_doc(:(รท=)) isa Markdown.MD +end