Skip to content

Commit

Permalink
Fix safe preview in ExperimentalLayout and embed_display (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Oct 30, 2023
1 parent a64ddd2 commit 3b699e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/components/TreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ export const TableView = ({ mime, body, cell_id, persist_js_state }) => {
</table>`
}

export let DivElement = ({ cell_id, style, classname, children, persist_js_state = false }) => {
const mimepair_output = (pair) => html`<${SimpleOutputBody} cell_id=${cell_id} mime=${pair[1]} body=${pair[0]} persist_js_state=${persist_js_state} />`
export let DivElement = ({ cell_id, style, classname, children, persist_js_state = false, sanitize_html = true }) => {
const mimepair_output = (pair) =>
html`<${SimpleOutputBody} cell_id=${cell_id} mime=${pair[1]} body=${pair[0]} persist_js_state=${persist_js_state} sanitize_html=${sanitize_html} />`

return html`<div style=${style} class=${classname}>${children.map(mimepair_output)}</div>`
}
1 change: 1 addition & 0 deletions src/runner/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,7 @@ function Base.show(io::IO, m::MIME"text/html", e::EmbeddableDisplay)
const display = create_new ? currentScript.previousElementSibling : this;
display.persist_js_state = true;
display.sanitize_html = false;
display.body = body;
if(create_new) {
// only set the mime if necessary, it triggers a second preact update
Expand Down

0 comments on commit 3b699e0

Please sign in to comment.