PacktPublishing / Vue-js-2-Web-Development-Projects

Vue js 2 Web Development Projects, published by Packt
MIT License
222 stars 144 forks source link

In Chapter 2, marked lib doesn't work #8

Closed Luminosite closed 4 years ago

Luminosite commented 4 years ago

Hi, I'm a newbie in front-end dev, and I met following issue when followed example codes: In chapter 2, it implemented markdown by a marked lib. But when I tried it in my example, I found PrerenceError: require is not defined marked:1:15 error in my web dev tool. I tried to fix it by import require.js in my html page, but it still can't load required module Lexer.js in marked lib. How to fix codes or is there any other available markdown lib?

vinzid commented 4 years ago

In beginning of the index.html, the following line links to the marked lib <script src="https://unpkg.com/marked"></script> You can change this line to the following: <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> The latter file is used for browser, while the former one should be used in cli now Reference: Marked.js Documentation

Luminosite commented 4 years ago

Thanks, new link works