Article: parse document separators properly
Document separators should start with a newline, followed by three dashes, followed by a newline again.
This commit is contained in:
parent
75f5d447d6
commit
48b95c4a13
|
@ -55,7 +55,7 @@ class Page {
|
||||||
this.m_name = file;
|
this.m_name = file;
|
||||||
this.m_contentSource = readText(file);
|
this.m_contentSource = readText(file);
|
||||||
// Find the seperator and split the string in two
|
// 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);
|
enforce!ArticleParseException(seperatorIndex >= 0);
|
||||||
|
|
||||||
string header = m_contentSource[0..seperatorIndex];
|
string header = m_contentSource[0..seperatorIndex];
|
||||||
|
|
Loading…
Reference in a new issue