Skip to content

Commit

Permalink
Fix preview on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
benabel committed Dec 16, 2023
1 parent 1710293 commit 7e0be4e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions content/edit.njk
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,18 @@ And a question:
- [x] True
- [ ] False
` }
console.log(emd)
// editor change listener
const updateListenerExtension = EditorView.updateListener.of((update) => {
if (update.docChanged) {
// Handle the event here
// handle doc change
// TODO maybe update only on ENTER
const newEmd = update
.state
.doc
.text
.toString();
updatePreview(newEmd.join("\n"))
updatePreview(newEmd)
}
});
// preview
Expand Down

0 comments on commit 7e0be4e

Please sign in to comment.