Front End Development Libraries Projects - Build a Markdown Previewer

Here is the library webpage,

Also explanation of this challenge gives to CDN link of this library. CDN means you can use an online code editor without installation. You can add this CDN via an HTML <script> tag or import it in the CodePen JS setup Package section. However, it gives an error because it imports a default export, but there is no default export. I fixed this by using the following approach:

import {marked} from "https://esm.sh/marked";
  const markdownHTML = marked.parse(input); 

Also I realise now, your codepeon have been installed Marked in Extarnad script section. You just need to import (you can import without cdn link with this way) and use it. Also you don’t need handleKeyUp.

  handleKeyUp(event) {
    const previewElement = document.getElementById('preview');
    if (previewElement) {
      previewElement.innerHTML = event.target.value;
    }
  }

If you use this, you update of innerHTML before dangerouslySetInnerHTML.