Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Nested inline nodes are not supported #1160

Open
jaapio opened this issue Oct 22, 2024 · 0 comments
Open

🐛 Nested inline nodes are not supported #1160

jaapio opened this issue Oct 22, 2024 · 0 comments
Labels
bug Something isn't working markdown

Comments

@jaapio
Copy link
Member

jaapio commented Oct 22, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working markdown
Projects
None yet
Development

No branches or pull requests

1 participant