stevie-c91 / laravel-markdown-editor

Add a Markdown editor (Toast UI Editor) to Laravel for content creation

Home Page:https://stevencotterill.com/articles/adding-a-markdown-editor-to-laravel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code Syntax Highlight Plugin

BlogProgWEB opened this issue · comments

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 :)