diff --git a/shared/use-markdown-parser.ts b/shared/use-markdown-parser.ts index d6683b268df54bd0b8c29c903db3cd6514e68ddf..1fcf10f86c531d8765c65abd8a63e15effd99377 100644 --- a/shared/use-markdown-parser.ts +++ b/shared/use-markdown-parser.ts @@ -19,7 +19,7 @@ function loadMarkdown(selectedServiceName: string) { function prepareContentFromMarkdown(markdownContent: string, selectedServiceName: string) { // eslint-disable-next-line no-unused-vars - const [header, metadata, text] = markdownContent.split('---') + const [header, metadata, text] = markdownContent.replace(/\r\n/g, '\n').split('---') const content: ServiceContent = parseMetadata(metadata) content.slug = selectedServiceName content.text = parseTextToHTMLString(text) @@ -34,7 +34,7 @@ function parseTextToHTMLString(markdownText: string) { } function parseMetadata(metadata: string): ServiceContent { - const lines: string[] = metadata.split('\n') + const lines: string[] = metadata.replace(/\r\n/g, '\n').split('\n') const content: ServiceContent = new ServiceContent() let parentKey: string = ''