diff --git a/frontend/components/Notebook.js b/frontend/components/Notebook.js index fcda9dcd46..00bd3c80fc 100644 --- a/frontend/components/Notebook.js +++ b/frontend/components/Notebook.js @@ -1,5 +1,5 @@ import { PlutoActionsContext } from "../common/PlutoContext.js" -import { html, useContext, useEffect, useMemo, useRef, useState } from "../imports/Preact.js" +import { html, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "../imports/Preact.js" import { Cell } from "./Cell.js" import { nbpkg_fingerprint } from "./PkgStatusMark.js" @@ -166,6 +166,20 @@ export const Notebook = ({ ), [notebook?.cell_dependencies] ) + + useLayoutEffect(() => { + let oldhash = window.location.hash + if (oldhash.length > 1) { + let go = () => { + window.location.hash = "#" + window.location.hash = oldhash + } + go() + // Scrolling there might trigger some codemirrors to render and change height, so let's do it again. + requestIdleCallback(go) + } + }, [cell_outputs_delayed]) + return html` ${notebook.cell_order diff --git a/src/runner/PlutoRunner/src/PlutoRunner.jl b/src/runner/PlutoRunner/src/PlutoRunner.jl index 466a7c2de1..e6469657b4 100644 --- a/src/runner/PlutoRunner/src/PlutoRunner.jl +++ b/src/runner/PlutoRunner/src/PlutoRunner.jl @@ -1249,7 +1249,7 @@ function format_output(binding::Base.Docs.Binding; context=default_iocontext) try ("""
- $(binding.var) + $(binding.var) $(repr(MIME"text/html"(), Base.Docs.doc(binding)))
""", MIME"text/html"())