Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Syntax Highlight Plugin #2

Open
BlogProgWEB opened this issue Jun 6, 2021 · 0 comments
Open

Code Syntax Highlight Plugin #2

BlogProgWEB opened this issue Jun 6, 2021 · 0 comments

Comments

@BlogProgWEB
Copy link

I try include Code Syntax Highlight Plugin

Install packages:

npm i @toast-ui/editor-plugin-code-syntax-highlight --save
npm i highlight.js --save

Added to code:

import codeSyntaxHighlight from '@toast-ui/editor-plugin-code-syntax-highlight';
import hljs from 'highlight.js';

const editor = new Editor({
    plugins: [[codeSyntaxHighlight, { hljs }]],
    el: document.querySelector('#editor'),
    height: '400px',
    initialEditType: 'markdown',
    placeholder: 'Write something cool!',
})

Then npn run dev
npmRunDev

But I get the error:
addEventType

errSources

Could you tell me what to do about it?
Maybe you can. At the same time, there will be a good demo and tutorial. Also, you can update the article on the site :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant