From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Rendering markdown and security vulnerabilities with injected HTML
From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
Rendering markdown and security vulnerabilities with injected HTML
All right, so let's render the actual content of the markdown. And we need a library for that to handle the React HTML. So we're going to go back into our terminal, and we're going to download npm install remark, which is a good library for rendering markdown. And we want specifically remark HTML. And we also want remark-html as well. So we're going to use both and install. And once this has completed its installation, we want to restart the development server because we're adding libraries here. It's going to change the packaging. So we're going to rerun the build, npm run dev. And now what we're going to do is go into our code base. And we're going to go to our library posts. And we want to update this get post data. Where is it? getPostData here, so that it also is going to not just give us this matter result content, but it actually processed that content. And we're going to make this an async function, because we actually need to wait for Remark to fetch all this data…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
How to create dynamic routes with Next.js7m 15s
-
(Locked)
getStaticPaths with Next.js implementation5m 14s
-
(Locked)
Mastering dynamic static rendering with Next.js12m 3s
-
(Locked)
Rendering markdown and security vulnerabilities with injected HTML11m 23s
-
(Locked)
Polishing the dynamic post pages10m 43s
-
(Locked)
Polishing a Next.js component with styling7m 22s
-
(Locked)
Fetching data and database querying plus ISR with Next.js11m 26s
-
(Locked)
API routes with Next.js9m 1s
-
(Locked)
-