From be443ac05451202fc92ca4fd8ad991c6057e0516 Mon Sep 17 00:00:00 2001 From: Sukera <11753998+Seelengrab@users.noreply.github.com> Date: Thu, 15 Jul 2021 12:14:27 +0200 Subject: [PATCH] REPL doc lookup assumed ASCII for the given string, fixes #41589 (#41594) --- stdlib/REPL/src/docview.jl | 2 +- stdlib/REPL/test/docview.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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