Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 1e607a9

Browse files
iblislinszha
authored andcommitted
Julia: fix filename quoting in docstring (#13894)
Quoting filename with backticks to prevent markdown mis-rendering some of them with underscore.
1 parent de5948b commit 1e607a9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

julia/src/util.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,14 @@ end
183183
Extract the line of `Defined in ...`
184184
185185
julia> mx._getdocdefine("sgd_update")
186-
"Defined in src/operator/optimizer_op.cc:L53"
187-
```
186+
"Defined in `src/operator/optimizer_op.cc:L53`"
188187
"""
189188
function _getdocdefine(name::String)
190189
op = _get_libmx_op_handle(name)
191190
str = _get_libmx_op_description(name, op)[1]
192191
lines = split(str, '\n')
193-
for m match.(Ref(r"^Defined in .*$"), lines)
194-
m != nothing && return m.match
192+
for m match.(Ref(r"^Defined in ([\S]+)$"), lines)
193+
m != nothing && return "Defined in `$(m.captures[1])`"
195194
end
196195
""
197196
end

0 commit comments

Comments
 (0)