diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..08f9db7
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,3 @@
+PATH_add zig-out/bin
+source .venv/bin/activate
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e73c22a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+.zig-cache/
+zig-out/
+
+.spec/
+
diff --git a/build.zig b/build.zig
index 813d69f..271bf91 100644
--- a/build.zig
+++ b/build.zig
@@ -38,7 +38,9 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});
+ const run_example_tests = b.addRunArtifact(example_tests);
+
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_exe_unit_tests.step);
- test_step.dependOn(&example_tests.step);
+ test_step.dependOn(&run_example_tests.step);
}
diff --git a/notes.md b/notes.md
index 89a6f8a..20bc895 100644
--- a/notes.md
+++ b/notes.md
@@ -2,6 +2,8 @@ The spec is organized into "content blocks", "leaf blocks", and inline content.
So the first task in the parser should be to parse the block structure.
+
foo→baz→→bim
+ \\
+
+);
+
+ const output = try convert(alloc, md);
+ defer alloc.free(output);
+
+ try std.testing.expectEqualStrings(html, output);
}
+
test "Example 2" {
const alloc = std.testing.allocator;
const md = (
\\→foo→baz→→bim
- );
+
+);
const html = (
\\foo→baz→→bim
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -26,17 +41,20 @@ test "Example 2" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 3" {
const alloc = std.testing.allocator;
const md = (
\\a→a
- );
+
+);
const html = (
\\a→a
\\ὐ→a
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -44,12 +62,13 @@ test "Example 3" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 4" {
const alloc = std.testing.allocator;
const md = (
\\-
- );
+);
const html = (
\\bar
\\foo
\\
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -84,16 +105,18 @@ test "Example 5" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 6" {
const alloc = std.testing.allocator;
const md = (
\\>→→foo
- );
+
+);
const html = (
\\
\\
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -101,17 +124,19 @@ test "Example 6" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 7" {
const alloc = std.testing.allocator;
const md = (
\\-→→foo
- );
+
+);
const html = (
\\
\\-
\\
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -119,18 +144,21 @@ test "Example 7" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 8" {
const alloc = std.testing.allocator;
const md = (
\\foo
\\→bar
- );
+
+);
const html = (
\\foo
\\bar
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -138,12 +166,13 @@ test "Example 8" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 9" {
const alloc = std.testing.allocator;
const md = (
\\-
- );
+);
const html = (
\\
\\- foo
@@ -156,7 +185,8 @@ test "Example 9" {
\\
\\
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -164,15 +194,18 @@ test "Example 9" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 10" {
const alloc = std.testing.allocator;
const md = (
\\#→Foo
- );
+
+);
const html = (
\\Foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -180,15 +213,17 @@ test "Example 10" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 11" {
const alloc = std.testing.allocator;
const md = (
\\*→*→*→
- );
+
+);
const html = (
\\
\?\@\[\\\]\^\_\`\{\|\}\~
- );
+
+);
const html = (
\\!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -212,15 +250,16 @@ test "Example 12" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 13" {
const alloc = std.testing.allocator;
const md = (
\\\→\A\a\
- );
+);
const html = (
\\\→\A\a\
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -228,15 +267,16 @@ test "Example 13" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 14" {
const alloc = std.testing.allocator;
const md = (
\\\*not
- );
+);
const html = (
\\
*not
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -244,15 +284,18 @@ test "Example 14" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 15" {
const alloc = std.testing.allocator;
const md = (
\\\\*emphasis*
- );
+
+);
const html = (
\\
\emphasis
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -260,16 +303,18 @@ test "Example 15" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 16" {
const alloc = std.testing.allocator;
const md = (
\\foo\
\\bar
- );
+
+);
const html = (
\\foo
\[\`
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -293,16 +340,19 @@ test "Example 17" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 18" {
const alloc = std.testing.allocator;
const md = (
\\\[\]
- );
+
+);
const html = (
\\\[\]
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -310,6 +360,7 @@ test "Example 18" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 19" {
const alloc = std.testing.allocator;
@@ -317,11 +368,13 @@ test "Example 19" {
\\~~~
\\\[\]
\\~~~
- );
+
+);
const html = (
\\\[\]
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -329,15 +382,17 @@ test "Example 19" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 20" {
const alloc = std.testing.allocator;
const md = (
\\
- );
+
+);
const html = (
\\
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -427,15 +487,16 @@ test "Example 25" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 26" {
const alloc = std.testing.allocator;
const md = (
\\#
- );
+);
const html = (
\\#
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -443,15 +504,16 @@ test "Example 26" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 27" {
const alloc = std.testing.allocator;
const md = (
\\"
- );
+);
const html = (
\\
"
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -459,15 +521,16 @@ test "Example 27" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 28" {
const alloc = std.testing.allocator;
const md = (
\\ 
- );
+);
const html = (
\\
 
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -475,15 +538,18 @@ test "Example 28" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 29" {
const alloc = std.testing.allocator;
const md = (
\\©
- );
+
+);
const html = (
\\
©
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -491,15 +557,18 @@ test "Example 29" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 30" {
const alloc = std.testing.allocator;
const md = (
\\&MadeUpEntity;
- );
+
+);
const html = (
\\&MadeUpEntity;
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -507,15 +576,16 @@ test "Example 30" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 31" {
const alloc = std.testing.allocator;
const md = (
\\föö
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -589,16 +665,19 @@ test "Example 35" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 36" {
const alloc = std.testing.allocator;
const md = (
\\föfö
- );
+
+);
const html = (
\\föfö
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -606,17 +685,20 @@ test "Example 36" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 37" {
const alloc = std.testing.allocator;
const md = (
\\*foo*
\\*foo*
- );
+
+);
const html = (
\\*foo*
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -624,15 +706,16 @@ test "Example 37" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 38" {
const alloc = std.testing.allocator;
const md = (
\\*
- );
+);
const html = (
\\*
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -640,17 +723,20 @@ test "Example 38" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 39" {
const alloc = std.testing.allocator;
const md = (
\\foo
bar
- );
+
+);
const html = (
\\
foo
\\
\\bar
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -658,15 +744,18 @@ test "Example 39" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 40" {
const alloc = std.testing.allocator;
const md = (
\\ foo
- );
+
+);
const html = (
\\→foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -674,15 +763,16 @@ test "Example 40" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 41" {
const alloc = std.testing.allocator;
const md = (
\\[a](url
- );
+);
const html = (
\\[a](url
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -690,18 +780,20 @@ test "Example 41" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 42" {
const alloc = std.testing.allocator;
const md = (
\\-
- );
+);
const html = (
\\
\\- `one
\\- two`
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -709,6 +801,7 @@ test "Example 42" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 43" {
const alloc = std.testing.allocator;
@@ -716,10 +809,11 @@ test "Example 43" {
\\***
\\---
\\___
- );
+
+);
const html = (
\\
+++
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -743,15 +840,18 @@ test "Example 44" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 45" {
const alloc = std.testing.allocator;
const md = (
\\===
- );
+
+);
const html = (
\\===
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -759,6 +859,7 @@ test "Example 45" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 46" {
const alloc = std.testing.allocator;
@@ -766,12 +867,14 @@ test "Example 46" {
\\--
\\**
\\__
- );
+
+);
const html = (
\\--
\\**
\\__
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -779,15 +882,17 @@ test "Example 46" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 47" {
const alloc = std.testing.allocator;
const md = (
\\***
- );
+
+);
const html = (
\\
***
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -812,16 +920,19 @@ test "Example 48" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 49" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+
+);
const html = (
\\Foo
\\***
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -829,15 +940,17 @@ test "Example 49" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 50" {
const alloc = std.testing.allocator;
const md = (
\\_____________________________________
- );
+
+);
const html = (
\\
_
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -925,15 +1043,18 @@ test "Example 55" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 56" {
const alloc = std.testing.allocator;
const md = (
\\*-*
- );
+
+);
const html = (
\\-
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -941,18 +1062,19 @@ test "Example 56" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 57" {
const alloc = std.testing.allocator;
const md = (
\\-
- );
+);
const html = (
\\
\\- foo
\\
\\
Foo
\\
Foo
\\bar
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -998,18 +1125,19 @@ test "Example 59" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 60" {
const alloc = std.testing.allocator;
const md = (
\\*
- );
+);
const html = (
\\
\\- Foo
\\
\\
\\- Foo
\\-
\\
foo
\\foo
@@ -1049,7 +1179,8 @@ test "Example 62" {
\\foo
\\foo
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1057,15 +1188,16 @@ test "Example 62" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 63" {
const alloc = std.testing.allocator;
const md = (
\\#######
- );
+);
const html = (
\\#######
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1073,15 +1205,16 @@ test "Example 63" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 64" {
const alloc = std.testing.allocator;
const md = (
\\#5
- );
+);
const html = (
\\
#5
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1089,15 +1222,16 @@ test "Example 64" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 65" {
const alloc = std.testing.allocator;
const md = (
\\\##
- );
+);
const html = (
\\
##
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1105,15 +1239,16 @@ test "Example 65" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 66" {
const alloc = std.testing.allocator;
const md = (
\\#
- );
+);
const html = (
\\
foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1121,15 +1256,17 @@ test "Example 66" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 67" {
const alloc = std.testing.allocator;
const md = (
\\#
- );
+);
const html = (
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1137,17 +1274,19 @@ test "Example 67" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 68" {
const alloc = std.testing.allocator;
const md = (
\\###
- );
+);
const html = (
\\foo
\\foo
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1155,15 +1294,16 @@ test "Example 68" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 69" {
const alloc = std.testing.allocator;
const md = (
\\#
- );
+);
const html = (
\\#
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1171,16 +1311,18 @@ test "Example 69" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 70" {
const alloc = std.testing.allocator;
const md = (
\\foo
- );
+
+);
const html = (
\\foo
\\#
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1188,16 +1330,18 @@ test "Example 70" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 71" {
const alloc = std.testing.allocator;
const md = (
\\##
- );
+);
const html = (
\\
foo
\\bar
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1205,16 +1349,18 @@ test "Example 71" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 72" {
const alloc = std.testing.allocator;
const md = (
\\#
- );
+);
const html = (
\\foo
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1222,15 +1368,17 @@ test "Example 72" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 73" {
const alloc = std.testing.allocator;
const md = (
\\###
- );
+);
const html = (
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1238,15 +1386,16 @@ test "Example 73" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 74" {
const alloc = std.testing.allocator;
const md = (
\\###
- );
+);
const html = (
\\foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1254,15 +1403,17 @@ test "Example 74" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 75" {
const alloc = std.testing.allocator;
const md = (
\\#
- );
+);
const html = (
\\foo#
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1270,15 +1421,16 @@ test "Example 75" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 76" {
const alloc = std.testing.allocator;
const md = (
\\###
- );
+);
const html = (
\\foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1286,16 +1438,17 @@ test "Example 76" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 77" {
const alloc = std.testing.allocator;
const md = (
\\****
\\##
- );
+);
const html = (
\\
Foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1319,17 +1473,19 @@ test "Example 78" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 79" {
const alloc = std.testing.allocator;
const md = (
\\##
- );
+);
const html = (
\\
\\
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1337,15 +1493,16 @@ test "Example 79" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 80" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+);
const html = (
\\Foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1353,15 +1510,16 @@ test "Example 80" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 81" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+);
const html = (
\\Foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1369,15 +1527,16 @@ test "Example 81" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 82" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+);
const html = (
\\Foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1385,6 +1544,7 @@ test "Example 82" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 83" {
const alloc = std.testing.allocator;
@@ -1394,11 +1554,13 @@ test "Example 83" {
\\
\\Foo
\\=
- );
+
+);
const html = (
\\Foo
\\Foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1406,6 +1568,7 @@ test "Example 83" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 84" {
const alloc = std.testing.allocator;
@@ -1413,12 +1576,14 @@ test "Example 84" {
\\Foo
\\---
\\
- );
+
+);
const html = (
\\Foo
\\Foo
\\Foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1426,12 +1591,14 @@ test "Example 84" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 85" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+
+);
const html = (
\\Foo
\\---
@@ -1439,7 +1606,7 @@ test "Example 85" {
\\Foo
\\
\\
Foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1463,16 +1633,19 @@ test "Example 86" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 87" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+
+);
const html = (
\\
Foo
\\---
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1480,17 +1653,18 @@ test "Example 87" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 88" {
const alloc = std.testing.allocator;
const md = (
\\Foo
\\=
- );
+);
const html = (
\\Foo
\\=
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1498,15 +1672,17 @@ test "Example 88" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 89" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+);
const html = (
\\
Foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1514,16 +1690,19 @@ test "Example 89" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 90" {
const alloc = std.testing.allocator;
const md = (
\\Foo\
\\----
- );
+
+);
const html = (
\\Foo\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1531,6 +1710,7 @@ test "Example 90" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 91" {
const alloc = std.testing.allocator;
@@ -1540,12 +1720,12 @@ test "Example 91" {
\\`
\\
\\`Foo
\\`
\\<a
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1553,18 +1733,19 @@ test "Example 91" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 92" {
const alloc = std.testing.allocator;
const md = (
\\>
- );
+);
const html = (
\\
\\Foo
\\
\\
- );
+);
const html = (
\\
\\foo
\\bar
\\===
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1592,18 +1775,19 @@ test "Example 93" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 94" {
const alloc = std.testing.allocator;
const md = (
\\-
- );
+);
const html = (
\\
\\- Foo
\\
\\
Foo
\\Bar
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1630,6 +1817,7 @@ test "Example 95" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 96" {
const alloc = std.testing.allocator;
@@ -1640,10 +1828,11 @@ test "Example 96" {
\\Bar
\\---
\\Baz
- );
+
+);
const html = (
\\
====
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1668,16 +1860,18 @@ test "Example 97" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 98" {
const alloc = std.testing.allocator;
const md = (
\\---
\\---
- );
+
+);
const html = (
\\
\\- foo
\\
foo
\\
\\\\\\foo
\\
Foo
\\baz
- ); + +); const output = try convert(alloc, md); defer alloc.free(output); @@ -1780,6 +1982,7 @@ test "Example 103" { try std.testing.expectEqualStrings(html, output); } + test "Example 104" { const alloc = std.testing.allocator; @@ -1790,12 +1993,13 @@ test "Example 104" { \\--- \\ \\baz - ); + +); const html = ( \\Foo \\bar
\\a
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1861,12 +2070,13 @@ test "Example 107" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 108" {
const alloc = std.testing.allocator;
const md = (
\\-
- );
+);
const html = (
\\
\\-
@@ -1874,7 +2084,8 @@ test "Example 108" {
\\
bar
\\
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1882,12 +2093,13 @@ test "Example 108" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 109" {
const alloc = std.testing.allocator;
const md = (
\\1.
- );
+);
const html = (
\\
\\-
@@ -1897,7 +2109,8 @@ test "Example 109" {
\\
\\
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1905,18 +2118,20 @@ test "Example 109" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 110" {
const alloc = std.testing.allocator;
const md = (
\\
- );
+
+);
const html = (
\\<a/>
\\*hi*
\\
\\-
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1924,13 +2139,15 @@ test "Example 110" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 111" {
const alloc = std.testing.allocator;
const md = (
\\chunk1
\\
- );
+
+);
const html = (
\\chunk1
\\
@@ -1940,7 +2157,8 @@ test "Example 111" {
\\
\\chunk3
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1948,15 +2166,18 @@ test "Example 111" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 112" {
const alloc = std.testing.allocator;
const md = (
\\chunk1
- );
+
+);
const html = (
\\chunk1
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1964,16 +2185,19 @@ test "Example 112" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 113" {
const alloc = std.testing.allocator;
const md = (
\\Foo
- );
+
+);
const html = (
\\Foo
\\bar
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -1981,18 +2205,21 @@ test "Example 113" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 114" {
const alloc = std.testing.allocator;
const md = (
\\foo
\\bar
- );
+
+);
const html = (
\\foo
\\
\\bar
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2000,12 +2227,13 @@ test "Example 114" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 115" {
const alloc = std.testing.allocator;
const md = (
\\#
- );
+);
const html = (
\\Heading
\\foo
@@ -2014,7 +2242,7 @@ test "Example 115" {
\\foo
\\
\\
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2038,16 +2268,19 @@ test "Example 116" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 117" {
const alloc = std.testing.allocator;
const md = (
\\
- );
+
+);
const html = (
\\foo
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2055,15 +2288,16 @@ test "Example 117" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 118" {
const alloc = std.testing.allocator;
const md = (
\\foo
- );
+);
const html = (
\\foo
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2071,16 +2305,19 @@ test "Example 118" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 119" {
const alloc = std.testing.allocator;
const md = (
\\```
\\<
- );
+
+);
const html = (
\\<
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2088,16 +2325,19 @@ test "Example 119" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 120" {
const alloc = std.testing.allocator;
const md = (
\\~~~
\\<
- );
+
+);
const html = (
\\<
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2105,6 +2345,7 @@ test "Example 120" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 121" {
const alloc = std.testing.allocator;
@@ -2112,10 +2353,12 @@ test "Example 121" {
\\``
\\foo
\\``
- );
+
+);
const html = (
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2123,6 +2366,7 @@ test "Example 121" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 122" {
const alloc = std.testing.allocator;
@@ -2131,12 +2375,14 @@ test "Example 122" {
\\aaa
\\~~~
\\```
- );
+
+);
const html = (
\\aaa
\\~~~
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2144,6 +2390,7 @@ test "Example 122" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 123" {
const alloc = std.testing.allocator;
@@ -2152,12 +2399,14 @@ test "Example 123" {
\\aaa
\\```
\\~~~
- );
+
+);
const html = (
\\aaa
\\```
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2165,6 +2414,7 @@ test "Example 123" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 124" {
const alloc = std.testing.allocator;
@@ -2173,12 +2423,14 @@ test "Example 124" {
\\aaa
\\```
\\``````
- );
+
+);
const html = (
\\aaa
\\```
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2186,6 +2438,7 @@ test "Example 124" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 125" {
const alloc = std.testing.allocator;
@@ -2194,12 +2447,14 @@ test "Example 125" {
\\aaa
\\~~~
\\~~~~
- );
+
+);
const html = (
\\aaa
\\~~~
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2207,15 +2462,18 @@ test "Example 125" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 126" {
const alloc = std.testing.allocator;
const md = (
\\```
- );
+
+);
const html = (
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2223,6 +2481,7 @@ test "Example 126" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 127" {
const alloc = std.testing.allocator;
@@ -2231,13 +2490,15 @@ test "Example 127" {
\\
\\```
\\aaa
- );
+
+);
const html = (
\\
\\```
\\aaa
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2245,19 +2506,21 @@ test "Example 127" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 128" {
const alloc = std.testing.allocator;
const md = (
\\>
- );
+);
const html = (
\\
\\aaa
\\
\\
\\bbb
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2265,16 +2528,19 @@ test "Example 128" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 129" {
const alloc = std.testing.allocator;
const md = (
\\```
\\
- );
+
+);
const html = (
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2282,16 +2548,19 @@ test "Example 129" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 130" {
const alloc = std.testing.allocator;
const md = (
\\```
\\```
- );
+
+);
const html = (
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2299,17 +2568,20 @@ test "Example 130" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 131" {
const alloc = std.testing.allocator;
const md = (
\\```
- );
+
+);
const html = (
\\aaa
\\aaa
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2317,19 +2589,22 @@ test "Example 131" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 132" {
const alloc = std.testing.allocator;
const md = (
\\```
\\aaa
- );
+
+);
const html = (
\\aaa
\\aaa
\\aaa
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2337,15 +2612,18 @@ test "Example 132" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 133" {
const alloc = std.testing.allocator;
const md = (
\\```
- );
+
+);
const html = (
\\aaa
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2353,18 +2631,21 @@ test "Example 133" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 134" {
const alloc = std.testing.allocator;
const md = (
\\```
- );
+
+);
const html = (
\\```
\\aaa
\\```
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2372,17 +2653,20 @@ test "Example 134" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 135" {
const alloc = std.testing.allocator;
const md = (
\\```
\\aaa
- );
+
+);
const html = (
\\aaa
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2390,17 +2674,20 @@ test "Example 135" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 136" {
const alloc = std.testing.allocator;
const md = (
\\```
\\aaa
- );
+
+);
const html = (
\\aaa
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2408,16 +2695,19 @@ test "Example 136" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 137" {
const alloc = std.testing.allocator;
const md = (
\\```
\\aaa
- );
+
+);
const html = (
\\aaa
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2425,15 +2715,16 @@ test "Example 137" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 138" {
const alloc = std.testing.allocator;
const md = (
\\```
- );
+);
const html = (
\\
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2441,6 +2732,7 @@ test "Example 138" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 139" {
const alloc = std.testing.allocator;
@@ -2448,11 +2740,11 @@ test "Example 139" {
\\~~~~~~
\\aaa
\\~~~
- );
+);
const html = (
\\aaa
\\~~~
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2460,6 +2752,7 @@ test "Example 139" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 140" {
const alloc = std.testing.allocator;
@@ -2469,13 +2762,15 @@ test "Example 140" {
\\bar
\\```
\\baz
- );
+
+);
const html = (
\\foo
\\bar
\\
\\baz
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2483,6 +2778,7 @@ test "Example 140" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 141" {
const alloc = std.testing.allocator;
@@ -2493,13 +2789,14 @@ test "Example 141" {
\\bar
\\~~~
\\#
- );
+);
const html = (
\\foo
\\bar
\\
\\baz
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2507,16 +2804,17 @@ test "Example 141" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 142" {
const alloc = std.testing.allocator;
const md = (
\\```ruby
\\def
- );
+);
const html = (
\\aa
\\foo
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2574,15 +2877,16 @@ test "Example 145" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 146" {
const alloc = std.testing.allocator;
const md = (
\\~~~
- );
+);
const html = (
\\```
- );
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2607,6 +2912,7 @@ test "Example 147" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 148" {
const alloc = std.testing.allocator;
@@ -2618,7 +2924,8 @@ test "Example 148" {
\\_world_.
\\
\\
- );
+
+);
const html = (
\\
\\
@@ -2626,7 +2933,8 @@ test "Example 148" {
\\world.
\\
\\
- );
+
+);
const output = try convert(alloc, md);
defer alloc.free(output);
@@ -2634,15 +2942,18 @@ test "Example 148" {
try std.testing.expectEqualStrings(html, output);
}
+
test "Example 149" {
const alloc = std.testing.allocator;
const md = (
\\