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
|
||||
const data = readFileSync(blogPath, 'utf-8');
|
||||
|
||||
// marked.use({
|
||||
// gfm: true,
|
||||
// breaks: true,
|
||||
//
|
||||
// });
|
||||
const marked = new Marked(
|
||||
markedHighlight({
|
||||
emptyLangClass: 'hljs',
|
||||
langPrefix: 'hljs language-',
|
||||
highlight(code, lang, info) {
|
||||
console.log("INFO: ", code);
|
||||
highlight(code, lang) {
|
||||
const language = hljs.getLanguage(lang) ? lang : 'plaintext';
|
||||
return hljs.highlight(code, { language }).value;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// Convert the markdown to HTML
|
||||
const html = marked.parse(data);
|
||||
console.log(html);
|
||||
|
||||
return {
|
||||
post: {
|
||||
content: html,
|
||||
// Convert the markdown to HTML
|
||||
content: marked.parse(data),
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user