diff --git a/packages/guides-markdown/resources/config/guides-markdown.php b/packages/guides-markdown/resources/config/guides-markdown.php index be525679d..4037a9933 100644 --- a/packages/guides-markdown/resources/config/guides-markdown.php +++ b/packages/guides-markdown/resources/config/guides-markdown.php @@ -11,6 +11,7 @@ use phpDocumentor\Guides\Markdown\Parsers\InlineParsers\InlineCodeParser; use phpDocumentor\Guides\Markdown\Parsers\InlineParsers\InlineImageParser; use phpDocumentor\Guides\Markdown\Parsers\InlineParsers\LinkParser; +use phpDocumentor\Guides\Markdown\Parsers\InlineParsers\NewLineParser; use phpDocumentor\Guides\Markdown\Parsers\InlineParsers\PlainTextParser; use phpDocumentor\Guides\Markdown\Parsers\InlineParsers\StrongParser; use phpDocumentor\Guides\Markdown\Parsers\ListBlockParser; @@ -73,6 +74,8 @@ ->set(InlineImageParser::class) ->arg('$inlineParsers', tagged_iterator('phpdoc.guides.markdown.parser.inlineParser')) ->tag('phpdoc.guides.markdown.parser.inlineParser') + ->set(NewLineParser::class) + ->tag('phpdoc.guides.markdown.parser.inlineParser') ->set(MarkupLanguageParser::class) ->arg('$parsers', tagged_iterator('phpdoc.guides.markdown.parser.blockParser')) diff --git a/packages/guides-markdown/src/Markdown/Parsers/InlineParsers/NewLineParser.php b/packages/guides-markdown/src/Markdown/Parsers/InlineParsers/NewLineParser.php new file mode 100644 index 000000000..86e30c7a5 --- /dev/null +++ b/packages/guides-markdown/src/Markdown/Parsers/InlineParsers/NewLineParser.php @@ -0,0 +1,40 @@ + */ +class NewLineParser extends AbstractInlineParser +{ + public function __construct() + { + } + + public function parse(MarkupLanguageParser $parser, NodeWalker $walker, CommonMarkNode $current): InlineNode + { + return new PlainTextInlineNode(' '); + } + + public function supports(NodeWalkerEvent $event): bool + { + return $event->isEntering() && $event->getNode() instanceof Newline; + } +} diff --git a/tests/Integration/tests/markdown/blockquote-md/expected/index.html b/tests/Integration/tests/markdown/blockquote-md/expected/index.html index 9c884e5c9..b17cc8da1 100644 --- a/tests/Integration/tests/markdown/blockquote-md/expected/index.html +++ b/tests/Integration/tests/markdown/blockquote-md/expected/index.html @@ -2,7 +2,7 @@
-This is a blockquote.It can span multiple lines.
+This is a blockquote. It can span multiple lines.
Italic or ItalicBold or Bold
+Italic or Italic Bold or Bold
In files of text, where words take flight,Markdown weaves its magic, bold and bright.Hashes and stars, a simple code,A poet's playground, where stories unfold. <BR>
+In files of text, where words take flight, Markdown weaves its magic, bold and bright. Hashes and stars, a simple code, A poet's playground, where stories unfold. <BR>
Powermail is a well-known, editor-friendly, powerful and easy to use mailform extension for TYPO3 with a lots of features (spam prevention, marketing information, optin, ajax submit, diagram analysis, etc...)
-Welcome to the world of fun and laughter with our child's swing! Follow thesimple steps below to ensure a safe and enjoyable experience for your littleone.
+Welcome to the world of fun and laughter with our child's swing! Follow the simple steps below to ensure a safe and enjoyable experience for your little one.
Choose a Sturdy Location: Select a location with a sturdy beam or swingset structure capable of supporting the weight of the swing and the child.
+Choose a Sturdy Location: Select a location with a sturdy beam or swing set structure capable of supporting the weight of the swing and the child.
Securely Attach the Swing: Use strong and reliable ropesor chains to securely attach the swing to the chosen location. Double-checkthe knots or hardware to ensure they are tight and safe.
+Securely Attach the Swing: Use strong and reliable ropes or chains to securely attach the swing to the chosen location. Double-check the knots or hardware to ensure they are tight and safe.
Adjust the Height: Adjust the height of the swing to a level that iscomfortable for your child. Ensure that it is not too high or too low.
+Adjust the Height: Adjust the height of the swing to a level that is comfortable for your child. Ensure that it is not too high or too low.
Place the Child in the Swing: Gently place your child in the swing seat,ensuring they are properly seated and secure.
+Place the Child in the Swing: Gently place your child in the swing seat, ensuring they are properly seated and secure.
Hold onto the Swing: Provide support and hold onto the swing until yourchild is comfortably seated and ready to swing.
+Hold onto the Swing: Provide support and hold onto the swing until your child is comfortably seated and ready to swing.
Start Swinging: Give a gentle push to start the swinging motion. Observeyour child's comfort level and adjust the swinging speed accordingly.
+Start Swinging: Give a gentle push to start the swinging motion. Observe your child's comfort level and adjust the swinging speed accordingly.
procedure startSwinging(swing, child)
while child.isComfortable()
swing.giveGentlePush()
@@ -71,12 +71,12 @@ Usage
Supervise Always: Always supervise your child while they are using theswing. Ensure they are using it safely and within the recommended age and weightlimits.
+Supervise Always: Always supervise your child while they are using the swing. Ensure they are using it safely and within the recommended age and weight limits.
-"Swinging is not just a physical activity; it's a journey into the world ofimagination and joy."
+"Swinging is not just a physical activity; it's a journey into the world of imagination and joy."
Check Hardware Regularly: Periodically inspect the ropes or chains, aswell as any hardware used to attach the swing. Replace any damaged or worn-outparts immediately.
+Check Hardware Regularly: Periodically inspect the ropes or chains, as well as any hardware used to attach the swing. Replace any damaged or worn-out parts immediately.
Set Age and Weight Limits: Follow the manufacturer's recommended age andweight limits for the swing. Do not exceed these limits to ensure safety.
+Set Age and Weight Limits: Follow the manufacturer's recommended age and weight limits for the swing. Do not exceed these limits to ensure safety.
Use Proper Attire: Encourage your child to wear appropriate clothing,including closed-toe shoes, to prevent any injuries.
+Use Proper Attire: Encourage your child to wear appropriate clothing, including closed-toe shoes, to prevent any injuries.
No Rough Play: Instruct your child not to engage in rough play or attemptto stand up in the swing.
+No Rough Play: Instruct your child not to engage in rough play or attempt to stand up in the swing.
Clean the Swing: Wipe down the swing seat regularly to keep it clean andfree from dirt or debris.
+Clean the Swing: Wipe down the swing seat regularly to keep it clean and free from dirt or debris.
Inspect for Wear: Check the swing's components for signs of wear ordamage. Replace any worn-out parts promptly.
+Inspect for Wear: Check the swing's components for signs of wear or damage. Replace any worn-out parts promptly.
Tighten Loose Hardware: Ensure that all nuts and bolts are securelytightened to maintain stability.
+Tighten Loose Hardware: Ensure that all nuts and bolts are securely tightened to maintain stability.
Swing Doesn't Move Smoothly: Check for any knots or tangles in the ropesor chains. Untangle and ensure a smooth swinging motion.
+Swing Doesn't Move Smoothly: Check for any knots or tangles in the ropes or chains. Untangle and ensure a smooth swinging motion.
Unusual Sounds: If you hear any creaking or unusual sounds, inspect thehardware for any loose or damaged parts.
+Unusual Sounds: If you hear any creaking or unusual sounds, inspect the hardware for any loose or damaged parts.
If you hear screaming or crying, untangle the child.
Uneven Swinging: Adjust the height of the swing to achieve a balanced andeven swinging motion.
+Uneven Swinging: Adjust the height of the swing to achieve a balanced and even swinging motion.
See https://www.example.com for additional information.
See also https://www.example.com/more.
-Lorem Ipsum Dolor.
-Paragraph 1
-Paragraph 2
-Paragraph 1
+ +Paragraph 2
+See the list
-A paragraph
-See the list
+ + +A paragraph
+Lorem Ipsum Dolor.
-