instance-oom / ngx-markdown-editor

Angular markdown editor based on ace editor
http://lon-yang.github.io/markdown-editor/
Apache License 2.0
174 stars 48 forks source link

Marked is not defined #109

Closed pj-alvarado10 closed 2 years ago

pj-alvarado10 commented 2 years ago

I have tested ngx-markdown-editor in Angular, with every step in the documentation, I have used the demo too, but I always have the error: Marked is not defined in ngx-markdown-editor.mjs (in the init method). I installed marked with npm i marked, and I import market in the files ngx-markdown-editor.mjs (import marked from 'marked'). There were not enough, then I put in my index the script: <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> The error marked is not defined persisted but only in another line of the file. I put this script in the index: <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.min.js" integrity="sha256-0Ed5s/n37LIeAWApZmZUhY9icm932KvYkTVdJzUBiI4=" crossorigin="anonymous"></script>

and the error changes to:

hljs is not defined. Please report this to https://github.com/markedjs/marked.

I don't know what to do. I'm sure that the last script is not the solution, but I don't know. If somebody can help me, I'm very glad.

Thank you.

instance-oom commented 2 years ago

Have you added assets、styles and scripts in your angular.json file? image

pj-alvarado10 commented 2 years ago

Yes, I do. I think that I must create a new project again to test. Thank you for your fast answer.