Closed krunal039 closed 6 years ago
When you use the editor.getHtml
it returns just the html . If you need the css too, you can use the editor.getCss()
.
I use newsletter-plugin and const html = window.grapesjs.editors[0].runCommand('gjs-get-inlined-html')
@arthuralmeidap thanks for reply but what I meant by just html, returned html looses all css class reference, if you look at attached picture, you will see all div's class attribute is removed. but i can see class applied in canvas.
@Geczy I tried editor.runCommand('get-inlined-html') but it does not return anything
As I said, the editor.getHtml()
does not returns the applied css on the canvas.
You will need a the editor.getCss()
to get the css
Include the newsletter plugin
@arthuralmeidap I am not after applied class defination(getCss() will return class defination), I am after correct html with class name applied. when I use html.getHtml() it remove some of applied classes from returned html.
I can see class applied in canvas like as I mentioned in image.
example:
canvas:
Also request you to look at image attached,
Don't think gjs-
prefixed classes will return
@Geczy correct, it does not return classname start with gjs, I have change class name prefix and it is fine now. Thanks for quick help.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I can see classes are added on canvas but when I get html via editor.gethtml(), i so some of classes are not included and it is just divs without any classes. attached screenshot with html on canvas and html via editor.gethtml()