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

Markdown Blockquotes

-

This is a blockquote.It can span multiple lines.

+

This is a blockquote. It can span multiple lines.

Blockquotes with Multiple Paragraphs

diff --git a/tests/Integration/tests/markdown/emphasis-md/expected/index.html b/tests/Integration/tests/markdown/emphasis-md/expected/index.html index 289fbc654..aa82e3c2b 100644 --- a/tests/Integration/tests/markdown/emphasis-md/expected/index.html +++ b/tests/Integration/tests/markdown/emphasis-md/expected/index.html @@ -2,7 +2,7 @@

Markdown with emphasis

-

Italic or ItalicBold or Bold

+

Italic or Italic Bold or Bold

diff --git a/tests/Integration/tests/markdown/html-inline-md/expected/index.html b/tests/Integration/tests/markdown/html-inline-md/expected/index.html index b55a33f7a..a805ea5b5 100644 --- a/tests/Integration/tests/markdown/html-inline-md/expected/index.html +++ b/tests/Integration/tests/markdown/html-inline-md/expected/index.html @@ -2,7 +2,7 @@

Markdown with html

-

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>

diff --git a/tests/Integration/tests/markdown/paragraph-md/expected/index.html b/tests/Integration/tests/markdown/paragraph-md/expected/index.html index 5e994a8df..99ee89798 100644 --- a/tests/Integration/tests/markdown/paragraph-md/expected/index.html +++ b/tests/Integration/tests/markdown/paragraph-md/expected/index.html @@ -1,8 +1,8 @@ -
-

TYPO3 Extension powermail

+
+

TYPO3 Extension powermail

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...)

-
+
diff --git a/tests/Integration/tests/markdown/paragraph-md/input/skip b/tests/Integration/tests/markdown/paragraph-md/input/skip deleted file mode 100644 index 965da06a7..000000000 --- a/tests/Integration/tests/markdown/paragraph-md/input/skip +++ /dev/null @@ -1 +0,0 @@ -Single line breaks within a paragraph in MarkDown are removed. GitHub treates them as a whitespace. \ No newline at end of file diff --git a/tests/Integration/tests/markdown/readme-md/expected/index.html b/tests/Integration/tests/markdown/readme-md/expected/index.html index c7f51fed5..082a65b2c 100644 --- a/tests/Integration/tests/markdown/readme-md/expected/index.html +++ b/tests/Integration/tests/markdown/readme-md/expected/index.html @@ -2,7 +2,7 @@

Child's Swing Usage Guide

-

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.

Table of Contents

@@ -37,13 +37,13 @@

Installation

  1. -

    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.

  2. -

    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.

  3. -

    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.

@@ -54,13 +54,13 @@

Usage

  1. -

    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.

  2. -

    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.

  3. -

    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

  4. -

    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."

Additional Tips:

@@ -99,16 +99,16 @@

Safety Guidelines

  1. -

    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.

  2. -

    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.

  3. -

    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.

  4. -

    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.

@@ -119,13 +119,13 @@

Maintenance

  1. -

    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.

  2. -

    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.

  3. -

    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.

@@ -136,15 +136,15 @@

Troubleshooting

  • -

    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.

diff --git a/tests/Integration/tests/markdown/url-embedded-md/expected/index.html b/tests/Integration/tests/markdown/url-embedded-md/expected/index.html index 20071e5aa..b3f9b0a7f 100644 --- a/tests/Integration/tests/markdown/url-embedded-md/expected/index.html +++ b/tests/Integration/tests/markdown/url-embedded-md/expected/index.html @@ -1,11 +1,11 @@ -
-

Sample Markdown Document

+
+

Sample Markdown Document

See https://www.example.com for additional information.

See also https://www.example.com/more.

-
+
diff --git a/tests/Integration/tests/navigation/breadcrumb/expected/page1.html b/tests/Integration/tests/navigation/breadcrumb/expected/page1.html index 191274130..5b29c07d8 100644 --- a/tests/Integration/tests/navigation/breadcrumb/expected/page1.html +++ b/tests/Integration/tests/navigation/breadcrumb/expected/page1.html @@ -1,136 +1,136 @@ -
-

Page 1

- +
+

Page 1

+

Lorem Ipsum Dolor.

- +
+

Page 1 Level 2

+

Page 1 Level 3

-

Page 1 Level 4

-
-
+

Page 1 Level 4

+
+
+
-
diff --git a/tests/Integration/tests/tables/grid-table-with-list/expected/index.html b/tests/Integration/tests/tables/grid-table-with-list/expected/index.html index fb598182b..306f8a987 100644 --- a/tests/Integration/tests/tables/grid-table-with-list/expected/index.html +++ b/tests/Integration/tests/tables/grid-table-with-list/expected/index.html @@ -1,4 +1,3 @@ -

table

@@ -6,21 +5,25 @@

table

Paragraphs - -

Paragraph 1

-

Paragraph 2

- + +

Paragraph 1

+ +

Paragraph 2

+ Lists -

See the list

-
    -
  • Item 1
  • -
  • Item 2
  • -
-

A paragraph

- +

See the list

+ + +
    +
  • Item 1
  • +
  • Item 2
  • +
+ +

A paragraph

+ diff --git a/tests/Integration/tests/toctree/toctree-glob-deep-level-3/expected/index.html b/tests/Integration/tests/toctree/toctree-glob-deep-level-3/expected/index.html index 7f33b6846..25436f370 100644 --- a/tests/Integration/tests/toctree/toctree-glob-deep-level-3/expected/index.html +++ b/tests/Integration/tests/toctree/toctree-glob-deep-level-3/expected/index.html @@ -1,118 +1,118 @@ -
-

Document Title

+