Skip to content

Commit d6130ac

Browse files
committed
[FEATURE] Create a rst theme to convert markdown
Convert basic mark-down into restructured Text * blockquote
1 parent 4249c13 commit d6130ac

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/guides-theme-rst/src/RstTheme/Twig/RstExtension.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
use Twig\TwigFilter;
2323
use Twig\TwigFunction;
2424

25+
use function array_map;
26+
use function explode;
27+
use function implode;
2528
use function min;
29+
use function preg_replace;
30+
use function rtrim;
2631
use function str_repeat;
2732
use function strlen;
2833

@@ -59,12 +64,14 @@ public function cleanContent(string $content): string
5964
$content = implode("\n", $lines);
6065

6166
$content = preg_replace('/(\n){2,}/', "\n\n", $content);
62-
return rtrim($content)."\n";
67+
68+
return rtrim($content) . "\n";
6369
}
6470

6571
public function renderRstIndent(string $text, int $indentNr): string
6672
{
67-
$indent = str_repeat(' ', $indentNr*4);
73+
$indent = str_repeat(' ', $indentNr * 4);
74+
6875
return preg_replace('/^/m', $indent, $text);
6976
}
7077

0 commit comments

Comments
 (0)