FIX: Removed print statements in the server
This commit is contained in:
parent
f46e87997d
commit
832d72347d
@ -19,30 +19,21 @@ export const load = async ({ url }: RequestEvent) => {
|
|||||||
// Read the file and get the data
|
// Read the file and get the data
|
||||||
const data = readFileSync(blogPath, 'utf-8');
|
const data = readFileSync(blogPath, 'utf-8');
|
||||||
|
|
||||||
// marked.use({
|
|
||||||
// gfm: true,
|
|
||||||
// breaks: true,
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
const marked = new Marked(
|
const marked = new Marked(
|
||||||
markedHighlight({
|
markedHighlight({
|
||||||
emptyLangClass: 'hljs',
|
emptyLangClass: 'hljs',
|
||||||
langPrefix: 'hljs language-',
|
langPrefix: 'hljs language-',
|
||||||
highlight(code, lang, info) {
|
highlight(code, lang) {
|
||||||
console.log("INFO: ", code);
|
|
||||||
const language = hljs.getLanguage(lang) ? lang : 'plaintext';
|
const language = hljs.getLanguage(lang) ? lang : 'plaintext';
|
||||||
return hljs.highlight(code, { language }).value;
|
return hljs.highlight(code, { language }).value;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Convert the markdown to HTML
|
|
||||||
const html = marked.parse(data);
|
|
||||||
console.log(html);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
post: {
|
post: {
|
||||||
content: html,
|
// Convert the markdown to HTML
|
||||||
|
content: marked.parse(data),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user