Documenter.jl: @repl generated output differs from REPL

Let’s say I want to generate the REPL sequence

julia> f(x) = x
f (generic function with 1 method)

julia> repr(f)
"f"

with a @repl block in Documenter.jl. If I write

```@repl
f(x) = x
repr(f)
```

then I get the output

julia> f(x) = x
f (generic function with 1 method)

julia> repr(f)
"Main.f"

How can I get rid of the “Main” (short of redefining repr)?