Replace → markup with tabs.
This commit is contained in:
@@ -38,6 +38,9 @@ for example in sel.css('.example'):
|
|||||||
md = ''.join(example.css('.language-markdown *::text').getall())
|
md = ''.join(example.css('.language-markdown *::text').getall())
|
||||||
html = ''.join(example.css('.language-html *::text').getall())
|
html = ''.join(example.css('.language-html *::text').getall())
|
||||||
|
|
||||||
|
md = md.replace('→', ' ')
|
||||||
|
html = html.replace('→', ' ')
|
||||||
|
|
||||||
assert name is not None
|
assert name is not None
|
||||||
|
|
||||||
write(f'''
|
write(f'''
|
||||||
|
@@ -6,38 +6,38 @@ const convert = @import("main.zig").convert;
|
|||||||
|
|
||||||
test "Example 1" {
|
test "Example 1" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\→foo→baz→→bim
|
\\ foo baz bim
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
try std.testing.expectEqualStrings(
|
try std.testing.expectEqualStrings(
|
||||||
\\<pre><code>foo→baz→→bim
|
\\<pre><code>foo baz bim
|
||||||
\\</code></pre>
|
\\</code></pre>
|
||||||
, output);
|
, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Example 2" {
|
test "Example 2" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\ →foo→baz→→bim
|
\\ foo baz bim
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
try std.testing.expectEqualStrings(
|
try std.testing.expectEqualStrings(
|
||||||
\\<pre><code>foo→baz→→bim
|
\\<pre><code>foo baz bim
|
||||||
\\</code></pre>
|
\\</code></pre>
|
||||||
, output);
|
, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Example 3" {
|
test "Example 3" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\ a→a
|
\\ a a
|
||||||
\\ ὐ→a
|
\\ ὐ a
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
try std.testing.expectEqualStrings(
|
try std.testing.expectEqualStrings(
|
||||||
\\<pre><code>a→a
|
\\<pre><code>a a
|
||||||
\\ὐ→a
|
\\ὐ a
|
||||||
\\</code></pre>
|
\\</code></pre>
|
||||||
, output);
|
, output);
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ test "Example 4" {
|
|||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\ - foo
|
\\ - foo
|
||||||
\\
|
\\
|
||||||
\\→bar
|
\\ bar
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ test "Example 5" {
|
|||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\- foo
|
\\- foo
|
||||||
\\
|
\\
|
||||||
\\→→bar
|
\\ bar
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ test "Example 5" {
|
|||||||
|
|
||||||
test "Example 6" {
|
test "Example 6" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\>→→foo
|
\\> foo
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ test "Example 6" {
|
|||||||
|
|
||||||
test "Example 7" {
|
test "Example 7" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\-→→foo
|
\\- foo
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ test "Example 7" {
|
|||||||
test "Example 8" {
|
test "Example 8" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\ foo
|
\\ foo
|
||||||
\\→bar
|
\\ bar
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ test "Example 9" {
|
|||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\ - foo
|
\\ - foo
|
||||||
\\ - bar
|
\\ - bar
|
||||||
\\→ - baz
|
\\ - baz
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ test "Example 9" {
|
|||||||
|
|
||||||
test "Example 10" {
|
test "Example 10" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\#→Foo
|
\\# Foo
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ test "Example 10" {
|
|||||||
|
|
||||||
test "Example 11" {
|
test "Example 11" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\*→*→*→
|
\\* * *
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
@@ -181,12 +181,12 @@ test "Example 12" {
|
|||||||
|
|
||||||
test "Example 13" {
|
test "Example 13" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\\→\A\a\ \3\φ\«
|
\\\ \A\a\ \3\φ\«
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
try std.testing.expectEqualStrings(
|
try std.testing.expectEqualStrings(
|
||||||
\\<p>\→\A\a\ \3\φ\«</p>
|
\\<p>\ \A\a\ \3\φ\«</p>
|
||||||
, output);
|
, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,7 +535,7 @@ test "Example 40" {
|
|||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
|
||||||
try std.testing.expectEqualStrings(
|
try std.testing.expectEqualStrings(
|
||||||
\\<p>→foo</p>
|
\\<p> foo</p>
|
||||||
, output);
|
, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1095,7 +1095,7 @@ test "Example 81" {
|
|||||||
test "Example 82" {
|
test "Example 82" {
|
||||||
const output = try convert(std.testing.allocator,
|
const output = try convert(std.testing.allocator,
|
||||||
\\ Foo *bar
|
\\ Foo *bar
|
||||||
\\baz*→
|
\\baz*
|
||||||
\\====
|
\\====
|
||||||
);
|
);
|
||||||
defer std.testing.allocator.free(output);
|
defer std.testing.allocator.free(output);
|
||||||
|
Reference in New Issue
Block a user