Skip to content

🐛 Nested inline nodes are not supported #1160

@jaapio

Description

@jaapio

Summary

Markdown does support nested styling like bold italic right now this is not allowed within this project. But also multiple plaintextnodes are not supported

A simple fix for multiple plaintext nodes could be:

guides-markdown/src/Markdown/Parsers/InlineParsers/AbstractInlineTextDecoratorParser.php

                $plainText = '';
                $showWarning = false;
                foreach ($content as $node) {
                    if ($node instanceof PlainTextInlineNode === false) {
                        $showWarning = true;
                    }

                    $plainText .= $node->getValue();
                }

                if ($showWarning) {
                    $this->logger->warning(sprintf('%s CONTEXT: Content of emphasis could not be interpreted: %s', $this->getType(), var_export($content, true)));
                }

                return $this->createInlineNode($commonMarkNode, $plainText);

Code snippet that reproduces the problem

 _**bold italic**_ 

Expected output

<i><b>bold italic</b></i>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmarkdown

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions