Skip to content

Commit

Permalink
Fix lazy rendered CM empty line display
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Apr 18, 2024
1 parent 320d195 commit fe4ead6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/components/CellInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,9 @@ const InputContextMenuItem = ({ contents, title, onClick, setOpen, tag }) =>
</li>`

const StaticCodeMirrorFaker = ({ value }) => {
const lines = value.split("\n").map((line, i) => html`<div class="awesome-wrapping-plugin-the-line cm-line" style="--indented: 0px;">${line}</div>`)
const lines = value
.split("\n")
.map((line, i) => html`<div class="awesome-wrapping-plugin-the-line cm-line" style="--indented: 0px;">${line.length === 0 ? html`<br />` : line}</div>`)

return html`
<div class="cm-editor ͼ1 ͼ2 ͼ4 ͼ4z cm-ssr-fake">
Expand Down

0 comments on commit fe4ead6

Please sign in to comment.