Skip to content

<mj-include> does not work inside <mj-head> #26

@jaredculp

Description

@jaredculp

Describe the bug

Using inside silently swallows all content.

To Reproduce
Steps to reproduce the behavior:

from mjml import mjml2html

template = """
<mjml>
    <mj-head>
        <mj-include path="styles.mjml" />
    </mj-head>
    <mj-body>
    </mj-body>
</mjml>
"""

loader = {
    "styles.mjml": "<mj-attributes><mj-text color='#ffffff' /></mj-attributes>",
}

print(mjml2html(template, include_loader=loader.__getitem__))

Expected behavior

Running the above code does not include the <mj-attributes> tag.

Environment (please complete the following information):

  • OS: MacOS
  • Arch: arm64
  • Python version: 3.11.8
  • Version: 1.3/0

Additional context
Add any other context about the problem here.

It looks like this may have been fixed upstream in MRML. Would it be possible to get a new release of mjml-python that includes this fix released?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions