Replace → markup with tabs.

This commit is contained in:
2024-11-12 09:06:57 -05:00
parent 7b568063ea
commit 9f59cde407
2 changed files with 23 additions and 20 deletions

View File

@@ -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'''

View File

@@ -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,
\\ aa
\\ ὐa
\\ a a
\\ ὐ a
);
defer std.testing.allocator.free(output);
try std.testing.expectEqualStrings(
\\<pre><code>aa
\\ὐ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);