mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-02 13:52:46 +02:00
Fix markdown rendering
This commit is contained in:
@@ -2,15 +2,19 @@
|
||||
import MarkdownIt from 'markdown-it';
|
||||
|
||||
export function markdownToHtml(markdown: string, isInline = true): string {
|
||||
const md = new MarkdownIt({
|
||||
html: true,
|
||||
linkify: true,
|
||||
});
|
||||
try {
|
||||
const md = new MarkdownIt({
|
||||
html: true,
|
||||
linkify: true,
|
||||
});
|
||||
|
||||
if (isInline) {
|
||||
return md.renderInline(markdown);
|
||||
} else {
|
||||
return md.render(markdown);
|
||||
if (isInline) {
|
||||
return md.renderInline(markdown);
|
||||
} else {
|
||||
return md.render(markdown);
|
||||
}
|
||||
} catch (e) {
|
||||
return markdown;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -81,6 +81,7 @@ export async function getAllQuestionGroups(): Promise<QuestionGroupType[]> {
|
||||
if (answerText.endsWith('.md')) {
|
||||
const answerFilePath = `/src/data/question-groups/${questionGroupDir}/content/${answerText}`;
|
||||
answerText =
|
||||
answerFilesMap[answerFilePath]?.default ||
|
||||
answerFilesMap[answerFilePath] ||
|
||||
`File missing: ${answerFilePath}`;
|
||||
|
||||
|
Reference in New Issue
Block a user