diff --git a/packages/guides-markdown/src/Markdown/Parsers/ListItemParser.php b/packages/guides-markdown/src/Markdown/Parsers/ListItemParser.php index dd58bb484..72d4de972 100644 --- a/packages/guides-markdown/src/Markdown/Parsers/ListItemParser.php +++ b/packages/guides-markdown/src/Markdown/Parsers/ListItemParser.php @@ -21,9 +21,12 @@ use phpDocumentor\Guides\MarkupLanguageParser; use phpDocumentor\Guides\Nodes\ListItemNode; use phpDocumentor\Guides\Nodes\Node; +use phpDocumentor\Guides\Nodes\ParagraphNode; use Psr\Log\LoggerInterface; use RuntimeException; +use function count; +use function current; use function sprintf; /** @extends AbstractBlockParser */ @@ -58,6 +61,10 @@ public function parse(MarkupLanguageParser $parser, NodeWalker $walker, CommonMa $prefix = $commonMarkNode->getListData()->bulletChar ?? $commonMarkNode->getListData()->delimiter ?? ''; $ordered = $commonMarkNode->getListData()->type === ListBlock::TYPE_ORDERED; + if (count($content) === 1 && current($content) instanceof ParagraphNode) { + $content = current($content)->getChildren(); + } + return new ListItemNode($prefix, $ordered, $content); } diff --git a/tests/Integration/tests-full/md-to-rst/blockquote-md-to-rst/expected/index.rst b/tests/Integration/tests-full/md-to-rst/blockquote-md-to-rst/expected/index.rst index 6c678a114..07595b132 100644 --- a/tests/Integration/tests-full/md-to-rst/blockquote-md-to-rst/expected/index.rst +++ b/tests/Integration/tests-full/md-to-rst/blockquote-md-to-rst/expected/index.rst @@ -17,7 +17,6 @@ Blockquotes with Other Elements The quarterly results look great! * Revenue was off the chart. - * Profits were higher than ever. *Everything* is going according to **plan**. diff --git a/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/expected/index.rst b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/expected/index.rst index 12d11e25b..a126d4f65 100644 --- a/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/expected/index.rst +++ b/tests/Integration/tests-full/md-to-rst/md-to-rst-list-link/expected/index.rst @@ -5,9 +5,7 @@ TYPO3 Extension powermail - Documentation This documentation helps * Administrators to install and configure powermail - * Editors to use powermail - * Developers to extend powermail Example Screenshots @@ -49,5 +47,4 @@ Documentation overview ====================== * `Introduction `__ - * `Documentation for editors `__ diff --git a/tests/Integration/tests/markdown/blockquote-md/expected/index.html b/tests/Integration/tests/markdown/blockquote-md/expected/index.html index b17cc8da1..c476e91b3 100644 --- a/tests/Integration/tests/markdown/blockquote-md/expected/index.html +++ b/tests/Integration/tests/markdown/blockquote-md/expected/index.html @@ -19,12 +19,8 @@

Blockquotes with Other Elements

    -
  • -

    Revenue was off the chart.

    -
  • -
  • -

    Profits were higher than ever.

    -
  • +
  • Revenue was off the chart.
  • +
  • Profits were higher than ever.

Everything is going according to plan.

diff --git a/tests/Integration/tests/markdown/link-page-md/expected/index.html b/tests/Integration/tests/markdown/link-page-md/expected/index.html index 72f99b7ee..e3606f3de 100644 --- a/tests/Integration/tests/markdown/link-page-md/expected/index.html +++ b/tests/Integration/tests/markdown/link-page-md/expected/index.html @@ -7,15 +7,9 @@

Markdown with links

diff --git a/tests/Integration/tests/markdown/link-page-md/expected/subpages/index.html b/tests/Integration/tests/markdown/link-page-md/expected/subpages/index.html index fa8d7dbd5..e5990ec4f 100644 --- a/tests/Integration/tests/markdown/link-page-md/expected/subpages/index.html +++ b/tests/Integration/tests/markdown/link-page-md/expected/subpages/index.html @@ -7,21 +7,11 @@

Markdown with links

diff --git a/tests/Integration/tests/markdown/lists-md/expected/index.html b/tests/Integration/tests/markdown/lists-md/expected/index.html index 997a44ca4..b5a816954 100644 --- a/tests/Integration/tests/markdown/lists-md/expected/index.html +++ b/tests/Integration/tests/markdown/lists-md/expected/index.html @@ -1,30 +1,23 @@ -
+ +

Markdown Lists

Unordered

    -
  • -

    Item 1

    -
  • +
  • Item 1
  • Item 2

      -
    • -

      Subitem A

      -
    • -
    • -

      Subitem B

      -
    • +
    • Subitem A
    • +
    • Subitem B
  • -
  • -

    Item 3

    -
  • +
  • Item 3
@@ -33,25 +26,17 @@

Ordered

    -
  1. -

    First item

    -
  2. +
  3. First item
  4. Second item

      -
    1. -

      Subitem A

      -
    2. -
    3. -

      Subitem B

      -
    4. +
    5. Subitem A
    6. +
    7. Subitem B
  5. -
  6. -

    Third item

    -
  7. +
  8. Third item
diff --git a/tests/Integration/tests/markdown/readme-md/expected/index.html b/tests/Integration/tests/markdown/readme-md/expected/index.html index 082a65b2c..073679018 100644 --- a/tests/Integration/tests/markdown/readme-md/expected/index.html +++ b/tests/Integration/tests/markdown/readme-md/expected/index.html @@ -9,21 +9,11 @@

Table of Contents


@@ -36,15 +26,9 @@

Installation

    -
  1. -

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

    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.

    -
  4. -
  5. -

    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.

    -
  6. +
  7. 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.
  8. +
  9. 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.
  10. +
  11. 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.
@@ -53,12 +37,8 @@

Usage

    -
  1. -

    Place the Child in the Swing: Gently place your child in the swing seat, ensuring they are properly seated and secure.

    -
  2. -
  3. -

    Hold onto the Swing: Provide support and hold onto the swing until your child is comfortably seated and ready to swing.

    -
  4. +
  5. Place the Child in the Swing: Gently place your child in the swing seat, ensuring they are properly seated and secure.
  6. +
  7. Hold onto the Swing: Provide support and hold onto the swing until your child is comfortably seated and ready to swing.
  8. 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)
    @@ -70,9 +50,7 @@ 

    Usage

  9. -
  10. -

    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.

    -
  11. +
  12. 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.
@@ -83,12 +61,8 @@

Additional Tips:

    -
  • -

    Bring your child's favorite toys to make swinging even more enjoyable.

    -
  • -
  • -

    Consider creating a soft landing area with cushions or grass underneath the swing.

    -
  • +
  • Bring your child's favorite toys to make swinging even more enjoyable.
  • +
  • Consider creating a soft landing area with cushions or grass underneath the swing.
@@ -98,18 +72,10 @@

Safety Guidelines

    -
  1. -

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

    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.

    -
  4. -
  5. -

    Use Proper Attire: Encourage your child to wear appropriate clothing, including closed-toe shoes, to prevent any injuries.

    -
  6. -
  7. -

    No Rough Play: Instruct your child not to engage in rough play or attempt to stand up in the swing.

    -
  8. +
  9. 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.
  10. +
  11. 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.
  12. +
  13. Use Proper Attire: Encourage your child to wear appropriate clothing, including closed-toe shoes, to prevent any injuries.
  14. +
  15. No Rough Play: Instruct your child not to engage in rough play or attempt to stand up in the swing.
@@ -118,15 +84,9 @@

Maintenance

    -
  1. -

    Clean the Swing: Wipe down the swing seat regularly to keep it clean and free from dirt or debris.

    -
  2. -
  3. -

    Inspect for Wear: Check the swing's components for signs of wear or damage. Replace any worn-out parts promptly.

    -
  4. -
  5. -

    Tighten Loose Hardware: Ensure that all nuts and bolts are securely tightened to maintain stability.

    -
  6. +
  7. Clean the Swing: Wipe down the swing seat regularly to keep it clean and free from dirt or debris.
  8. +
  9. Inspect for Wear: Check the swing's components for signs of wear or damage. Replace any worn-out parts promptly.
  10. +
  11. Tighten Loose Hardware: Ensure that all nuts and bolts are securely tightened to maintain stability.
@@ -135,17 +95,13 @@

Troubleshooting

    -
  • -

    Swing Doesn't Move Smoothly: Check for any knots or tangles in the ropes or 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 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 and even swinging motion.

    -
  • +
  • Uneven Swinging: Adjust the height of the swing to achieve a balanced and even swinging motion.