From ca395d8afe5720f44dff3d62506aa7cbaa0dce13 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Sat, 16 Mar 2024 12:21:11 +0100 Subject: [PATCH] [FEATURE] Support Parsed Literal Block resolves: #927 releases: main, 1.0 --- .../Directives/CodeBlockDirective.php | 2 +- .../code/parsed-literal-block/expected/index.html | 12 ++++++++++++ .../tests/code/parsed-literal-block/input/index.rst | 10 ++++++++++ .../tables/list-table-directive/expected/index.html | 9 --------- 4 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 tests/Integration/tests/code/parsed-literal-block/expected/index.html create mode 100644 tests/Integration/tests/code/parsed-literal-block/input/index.rst diff --git a/packages/guides-restructured-text/src/RestructuredText/Directives/CodeBlockDirective.php b/packages/guides-restructured-text/src/RestructuredText/Directives/CodeBlockDirective.php index 89141dad4..e001e5868 100644 --- a/packages/guides-restructured-text/src/RestructuredText/Directives/CodeBlockDirective.php +++ b/packages/guides-restructured-text/src/RestructuredText/Directives/CodeBlockDirective.php @@ -49,7 +49,7 @@ public function getName(): string /** {@inheritDoc} */ public function getAliases(): array { - return ['code']; + return ['code', 'parsed-literal']; } /** {@inheritDoc} */ diff --git a/tests/Integration/tests/code/parsed-literal-block/expected/index.html b/tests/Integration/tests/code/parsed-literal-block/expected/index.html new file mode 100644 index 000000000..3246af980 --- /dev/null +++ b/tests/Integration/tests/code/parsed-literal-block/expected/index.html @@ -0,0 +1,12 @@ + +
+

Title

+ +
// Define a custom HTML entity for a regular space character
+$regularSpaceEntity = ' ';
+
+// Output the regular space character using the custom HTML entity
+echo "This is a" . $regularSpaceEntity . "space";
+
+ + diff --git a/tests/Integration/tests/code/parsed-literal-block/input/index.rst b/tests/Integration/tests/code/parsed-literal-block/input/index.rst new file mode 100644 index 000000000..49d634443 --- /dev/null +++ b/tests/Integration/tests/code/parsed-literal-block/input/index.rst @@ -0,0 +1,10 @@ +Title +===== + +.. parsed-literal:: + + // Define a custom HTML entity for a regular space character + $regularSpaceEntity = ' '; + + // Output the regular space character using the custom HTML entity + echo "This is a" . $regularSpaceEntity . "space"; diff --git a/tests/Integration/tests/tables/list-table-directive/expected/index.html b/tests/Integration/tests/tables/list-table-directive/expected/index.html index 5f579181b..f13f0c6c7 100644 --- a/tests/Integration/tests/tables/list-table-directive/expected/index.html +++ b/tests/Integration/tests/tables/list-table-directive/expected/index.html @@ -1,10 +1,3 @@ - - - - table - - -

table

@@ -71,5 +64,3 @@

table

- -