Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Special characters are not rendering when HTML is copied #50

Open
srkennedy opened this issue Nov 21, 2018 · 11 comments
Open

Special characters are not rendering when HTML is copied #50

srkennedy opened this issue Nov 21, 2018 · 11 comments

Comments

@srkennedy
Copy link

srkennedy commented Nov 21, 2018

Expected behavior

When you export the MJML from VSC, special characters, such as an m-dash "—", should display properly.

Actual behavior

When the HTML is copied, it is converting the m-dash to —. Other symbols have been getting converted to gibberish as well.

Originally, VSC was in windows 1252 so I thought that the encoding was the problem but it is still persisting even after I have converted to UTF-8.

If I export copy the HTML from the exact same file via the MJML desktop app, then all the HTML is good and symbols display correctly.

Update: Exporting now works. Must have been an issue with exporting in Windows 1252. Copying the HTML is still not working.

Steps to reproduce the problem

  1. Write MJML in VSC as normal and use special characters, like m-dashes (not the — but using the actual "—" character)
  2. Copy the code
  3. Paste the HTML into ESP or editor and the symbols will be encoded differently.

Code sample

<mj-text padding-top="0">
    <p>This is some content about nothing—but it is about something.</p>
</mj-text>

Specifications

  • VS Code version: 1.29.1
  • MJML extension version: 1.6.0
  • Operating system and version: macOS Mojave v10.14

Other information

Not sure if there is a setting in VSC to address this or if it is an issue with the way the HTML is being compiled but I've tried updating all the encoding settings I can find to make sure UTF-8 is used but can't figure out why the MJML desktop apps works and VSC doesn't. My only thought is there is an encoding issue when the HTML is compiled.

@dnuanes
Copy link

dnuanes commented Nov 22, 2018

Hi, have you tried running the export HTML command within vsc? I use em dashes regularly, but run the export command instead of the copy command, and have never run into an issue.

@srkennedy
Copy link
Author

I ran the export before and got the same issue, but maybe that was before switching to UTF-8. When I export now, it appears to be ok. Nonetheless, would prefer to be able to copy the HTML to paste into my ESP rather than export, then copy, then paste in.

@srkennedy srkennedy changed the title Special characters are not rendering when HTML is exported Special characters are not rendering when HTML is copied Nov 22, 2018
@Redjam
Copy link

Redjam commented Nov 30, 2018

Hi @srkennedy I have the same issue. Whether I export or copy to HTML, both give me errors.

MJML environment
OS: MacOS
MJML Version 4.2.0
MJML tool used : MJML extension for VS Code Mac 1.6.0

image
image

Did you find a solution? How did you converted to UTF-8? Many thanks in advance !

@srkennedy
Copy link
Author

@Redjam Nope. I'm just writing special characters as the coded version (ie. &mdash;) to get around it. Or I use the MJML desktop app to copy the HTML.

I also updated a few things to see if that worked.

Set UTF-8 as default in the settings.

Added this to the settings.json

"files.encoding": "utf8",
    "[mjml]": {
        "files.encoding": "utf8",   
    }

Then I went through each file to make sure they were set to UTF-8 and not Windows 1252.

Still no luck though. But that's what I've done so far to try and fix.

@attilabuti
Copy link
Owner

Hello

I would like to release a new version in the next week.

@Redjam
Copy link

Redjam commented Dec 5, 2018

Thanks both of you for your answers. @attilabuti I'm looking forward to the next release. many thanks for your work!

@Redjam
Copy link

Redjam commented Jan 7, 2019

Hi @attilabuti, any update about the next release?

@srkennedy
Copy link
Author

Hey @attilabuti. Any updates on this issue? 🤞🏼

@crixlet
Copy link

crixlet commented Aug 28, 2019

Has anyone found a resolution to this?

@Redjam
Copy link

Redjam commented Sep 5, 2019

@aaroneight no resolution for the moment. I use the online converter to avoid mistakes caused by VS extension.

@mindesik
Copy link

mindesik commented Oct 11, 2019

Also issue with cyrillic characters. I'm getting this: https://shrtm.nu/9C1b instead of this: https://shrtm.nu/fiD8.
This happens only when using "MJML: Copy HTML" command, while "MJML: Export HTML" command is working ok.

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

No branches or pull requests

6 participants