summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/front_matter.md
blob: e01fd4e7893ce188b5a168cc8151bd839b2aa1fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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>
.