Skip to content

Commit

Permalink
Add parse markdown #29
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaSelezneva committed Apr 26, 2023
1 parent fcf622e commit 5634151
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {merge} = require('lodash');
const http = require('https');
const xml = require('xml');
const parseUrl = require('parse-url');
const marked = require('marked');

class Channel {
id;
Expand Down Expand Up @@ -442,7 +443,7 @@ function prerender(tutorial) {
}

if (!!tutorial.markdown) {
output = output.replace('<!--prerender-->', tutorial.markdown);
output = output.replace('<!--prerender-->', marked.parse(tutorial.markdown));
}
output = output.replace(/<title>.+<\/title>/, `<title>${tutorial.title}</title>`);
return output;
Expand Down

0 comments on commit 5634151

Please sign in to comment.