Skip to content

Commit

Permalink
Rewrite comment and move to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHatherly committed Oct 16, 2024
1 parent 7723754 commit f1b5e21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/QuartoNotebookWorker/src/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ function _render_thunk(
end
end

# Setting the `helpmode` module isn't an option on Julia 1.6 so we need to
# manually replace `Main` with the module we want.
function _helpmode(code::AbstractString, mod::Module)
@static if VERSION < v"1.11.0"

Check warning on line 123 in src/QuartoNotebookWorker/src/render.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/render.jl#L123

Added line #L123 was not covered by tests
# Earlier versions of Julia don't have the `helpmode` method that takes
# `io`, `code`, `mod` and so we have to manually alter the returned
# expression instead.
ex = REPL.helpmode(code)
ex = postwalk(ex) do x
return x == Main ? mod : x

Check warning on line 129 in src/QuartoNotebookWorker/src/render.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/render.jl#L127-L129

Added lines #L127 - L129 were not covered by tests
Expand Down

0 comments on commit f1b5e21

Please sign in to comment.