Invalid Id attribute on mjml image tag
See original GitHub issueWhen utilizing the asset manager to upload a new image, the asset manager attaches an id attribute to the mjml image tag. This id attribute causes an mjml validation error preventing the use of mjml strict validation in down stream applications.
Steps to reproduce:
-
Navigate to https://grapesjs.com/demo-mjml.html
-
Double click on the sciolino-paris-bw.jpg image opeing the asset manager
-
choose an image of your choice replacing the Parisian photo
-
View code via the </> icon and be alerted to a warning
- infringing line of code
<mj-column>
<mj-image width="200px" src="//placehold.it/350x250/78c5d6/fff/image1.jpg" id="is2ee"/>
</mj-column>
Open questions: I have yet to dig into the asset manager code to identify a fix. is the id a critical part of the asset manager functionality?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
mjml-guides – Documentation for MJML - The Responsive ...
This tag allows you to add custom attributes on any html tag of the generated html, using css selectors. It's not needed for...
Read more >HTML image not showing in Gmail - Stack Overflow
I noticed that Google was stripping the src attribute from my img tags. I tried every answer on this page - with no...
Read more >Template Management - Mailjet Help Center
Use MJML Code – MJML is Mailjet's markup language designed to reduce the pain of coding responsive emails. Import existing MJML templates ...
Read more >As a side note, I'm amazed that it's 2021 and there's no good ...
If you just want text and images, you don't need CSS. Just the <img> tag - and even there you'll run into differences...
Read more >mjml-image - npm
attribute unit default value
align position center
alt string n/a
border string none
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Dirty fix : add regex to all editor.getHtml() function like that
editor.getHtml().replaceAll(new RegExp(/ id="([^"]+)"/g),'')
it will remove all ids. Not clean, but works!
Thank you so much! I have reprocessed it:
I try to use
component.removeAttributes('id')
orbut still can not remove component ID.