Make a table - Build a Markdown Previewer

Tell us what’s happening:

hello i want make a markdown previewer but i blocked on make a table someone can give a advice ? i don’t think it is important but here my code on codepen:

like i’m not finish it’s a little bit messy.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36

Challenge Information:

Front End Development Libraries Projects - Build a Markdown Previewer

Did you see this hint:

(HINT: You don’t need to parse Markdown yourself - you can import the Marked library for this: marked - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers)

1 Like

thank you for answer but i need to advice to a table so when i type this:

Wild Header Crazy Header Another Header?
Your content can be here, and it can be here…
And here. Okay. I think we get it.

i should be have:

<table>
<tr><th>Wild Header</th><th>Crazy Header</th><th>Another Header?</th></tr>
<tr><td>Your content can</td><td>be here, and it</td><td>can be here…</td></tr>
<tr><td>And here.</td><td>Okay.</td><td>I think we get it.</td></tr>
</table>

or something like this

My advice is to use the marked library.

You can code all of this yourself, but you’re meant to use the marked library to do it for you.

Do you understand?

what !!! wait wait i don’t understand you say the marked library can make a table for me ? i thought must code the balise like <b>bold</b>myself and THEN use the Marked library to render in HTML element like this bold. i will make a research about Marked library

1 Like

the Marked library is able to take the markdown syntax and transform it into HTML, you don’t need to do that yourself

1 Like

Thank you for your answer

1 Like

Correct, the user will type HTML into the first window and you will code the app to use Marked to transform the HTML into rendered HTML.

Add this external JS script in your codepen settings, this is the one that worked for me:

https://cdnjs.cloudflare.com/ajax/libs/marked/11.1.0/marked.min.js

Or it might be this one

https://cdnjs.cloudflare.com/ajax/libs/marked/2.0.0/marked.min.js

Neither of mine work anymore unfortunately…

1 Like