From 48b95c4a130ae0b105076a3bdca27444ab2e540d Mon Sep 17 00:00:00 2001 From: Henk Kalkwater Date: Mon, 11 Oct 2021 15:15:12 +0200 Subject: [PATCH] Article: parse document separators properly Document separators should start with a newline, followed by three dashes, followed by a newline again. --- source/nl/netsoj/chris/blog/model/page.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/nl/netsoj/chris/blog/model/page.d b/source/nl/netsoj/chris/blog/model/page.d index c3e71e5..833cf46 100644 --- a/source/nl/netsoj/chris/blog/model/page.d +++ b/source/nl/netsoj/chris/blog/model/page.d @@ -55,7 +55,7 @@ class Page { this.m_name = file; this.m_contentSource = readText(file); // Find the seperator and split the string in two - const uint seperatorIndex = cast(uint) lastIndexOf(m_contentSource, "---\n"); + const uint seperatorIndex = cast(uint) lastIndexOf(m_contentSource, "\n---\n"); enforce!ArticleParseException(seperatorIndex >= 0); string header = m_contentSource[0..seperatorIndex];