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

Problem Compiling Font Names #59

Open
ben-demotic opened this issue Nov 18, 2024 · 2 comments
Open

Problem Compiling Font Names #59

ben-demotic opened this issue Nov 18, 2024 · 2 comments

Comments

@ben-demotic
Copy link

With the latest 2.0.0 release of the extension, font families which contain spaces are compiled to HTML incorrectly.

Using an mj-all tag:

<mj-all font-family="'Source Sans 3', Arial, sans-serif" font-size="16px" line-height="1.4" color="#0f3549" />

Expected behavior

This will compile to this for example:

<div style="color:#0f3549;font-family:'Source Sans 3',Arial,sans-serif;font-size:16px;line-height:1.4;text-align:left">

An email sent using this template will render correctly in an email client.

Actual behavior

It now compiles to this:

<div style="color:#0f3549;font-family:Source Sans\ 3,Arial,sans-serif;font-size:16px;line-height:1.4;text-align:left">

The quotations around 'Source Sans 3' have been removed and a backslash introduced.

An email sent using this template will not render correctly in Gmail (at least). The text is just missing altogether.

Steps to reproduce the problem

Take a basic template like this, compile it using the "MJML: Export HTML" function and check the HTML output:

<mjml>
  <mj-head>
    <mj-title>Test Email</mj-title>
    <mj-font name="Source Sans 3" href="https://fonts.googleapis.com/css2?family=Source+Sans+3" />
    <mj-attributes>
      <mj-all font-family="'Source Sans 3', Arial, sans-serif" font-size="16px" line-height="1.4" color="#0f3549" />
    </mj-attributes>
  </mj-head>
  <mj-body background-color="#f6f6f6" width="700px">
    <mj-section background-color="#ffffff" padding-bottom="0px">
      <mj-column>
        <mj-image align="left" width="240px" src="https://img.logoipsum.com/330.svg" alt="Logo" />
      </mj-column>
    </mj-section>
    <mj-section background-color="#ffffff" padding-top="0px" padding-bottom="0px">
      <mj-column>
        <mj-text padding-bottom="0px">
          <p><strong>*** THIS IS A TEST EMAIL. PLEASE DO NOT REPLY TO THIS MESSAGE. ***</strong></p>
          <p>In reprehenderit et in tempor sit aliquip enim.</p>
        </mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Specifications

  • VS Code version: 1.95.2
  • MJML extension version: v2.0.0
  • Operating system and version: Windows 11 Pro 23H2

Other information

Pasting the same template into the "try-it-live" editor gives the expected, correct, output.

@iRyusa
Copy link
Member

iRyusa commented Nov 18, 2024

I think it's related to MJML5 rather than this extension can you please open it on MJML repo to link it ?

@ben-demotic
Copy link
Author

@iRyusa filed against MJML here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants