From 3f8d41794e228a2f854a9b4eefa53c7c3b96c880 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Mon, 18 Jan 2021 17:27:58 -0500 Subject: [PATCH] Add horizontal rule --- src/Nodes/HorizontalRule.php | 14 ++++++++ src/Renderer.php | 1 + tests/Nodes/HorizontalRuleNodeTest.php | 44 ++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/Nodes/HorizontalRule.php create mode 100644 tests/Nodes/HorizontalRuleNodeTest.php diff --git a/src/Nodes/HorizontalRule.php b/src/Nodes/HorizontalRule.php new file mode 100644 index 0000000..c54bb65 --- /dev/null +++ b/src/Nodes/HorizontalRule.php @@ -0,0 +1,14 @@ + 'doc', + 'content' => [ + [ + 'type' => 'paragraph', + 'content' => [ + [ + 'type' => 'text', + 'text' => 'some text', + ], + ], + ], + [ + 'type' => 'horizontal_rule', + ], + [ + 'type' => 'paragraph', + 'content' => [ + [ + 'type' => 'text', + 'text' => 'some more text', + ], + ], + ], + ], + ]; + + $html = '

some text


some more text

'; + + $this->assertEquals($html, (new Renderer)->render($json)); + } +}