From c472f71d3a2cc810d0be74bb7a6877f433db510c Mon Sep 17 00:00:00 2001 From: jvo-63 <juergen.voskuhl@itcv-software.com> Date: Mon, 28 Aug 2023 10:23:07 +0200 Subject: [PATCH] Replace CR-LF (used in Windows) by LF --- shared/use-markdown-parser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/use-markdown-parser.ts b/shared/use-markdown-parser.ts index d6683b2..1fcf10f 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 = '' -- GitLab