<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/stackedit-js@1.0.5/docs/lib/stackedit.min.js"></script>
</head>
<body>
<textarea></textarea>
<script>
const el = document.querySelector('textarea');
const stackedit = new Stackedit();
// Open the iframe
stackedit.openFile({
name: 'Filename', // with an optional filename
content: {
text: el.value // and the Markdown content.
}
});
// Listen to StackEdit events and apply the changes to the textarea.
stackedit.on('fileChange', (file) => {
el.value = file.content.text;
});
</script>
</body>
</html>
It worked for a while but then the following error started showing up:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('file://') does not match the recipient window's origin ('null').
It appears in the console as soon as the page loads. It also appears for every key that I type in the markdown section in the editor
My code is as follows:
It worked for a while but then the following error started showing up:
It appears in the console as soon as the page loads. It also appears for every key that I type in the markdown section in the editor