summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/front_matter.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/fixtures/front_matter.md87
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/fixtures/front_matter.md b/tests/fixtures/front_matter.md
new file mode 100644
index 0000000..e01fd4e
--- /dev/null
+++ b/tests/fixtures/front_matter.md
@@ -0,0 +1,87 @@
+
+should parse empty front matter:
+.
+---
+---
+# Head
+.
+
+<h1>Head</h1>
+.
+
+
+should parse basic front matter:
+.
+---
+x: 1
+---
+# Head
+.
+
+<h1>Head</h1>
+.
+
+should parse until triple dots:
+.
+---
+x: 1
+...
+# Head
+.
+
+<h1>Head</h1>
+.
+
+should parse front matter with indentation:
+.
+---
+title: Associative arrays
+people:
+ name: John Smith
+ age: 33
+morePeople: { name: Grace Jones, age: 21 }
+---
+# Head
+.
+
+<h1>Head</h1>
+.
+
+should ignore spaces after front matter delimiters:
+.
+---
+title: Associative arrays
+people:
+ name: John Smith
+ age: 33
+morePeople: { name: Grace Jones, age: 21 }
+---
+# Head
+.
+
+<h1>Head</h1>
+.
+
+should ignore front matter with less than 3 opening dashes:
+.
+--
+x: 1
+--
+# Head
+.
+<h2>--
+x: 1</h2>
+<h1>Head</h1>
+.
+
+should require front matter have matching number of opening and closing dashes:
+.
+----
+x: 1
+---
+# Head
+.
+<hr>
+<h2>x: 1</h2>
+<h1>Head</h1>
+.