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