-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
HTML Parser does not honor custom added component types #43
Comments
Hi @sebastianha thanks for the hint <div id="gjs">
...
<cutom-element></cutom-element>
...
</div>
<script>
var editor = grapesjs.init({
container : '#gjs',
fromElement: true,
});
editor.DomComponents.addType('cutom-element-type', {...});
</script> In the example above the editor will not get the new type from the HTML because the content is already parsed and appended, so it'll get it only with new components (eg. from Blocks) Solution 1: turn off <script>
var editor = grapesjs.init({
autorender: 0,
container : '#gjs',
fromElement: true,
});
editor.DomComponents.addType('cutom-element-type', {...});
// after all new types
editor.render();
</script> Solution 2: put all the stuff inside a plugin (Creating plugins) Could you try and let me know? If it's not working please post some reproducible example. |
That's it, thank you very much! |
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 am currently trying to implement by own custom component type and it seems to me that the html parser does not honor custom component types with their isComponent method and therefore they are not recognized as components. Can you reproduce this?
The text was updated successfully, but these errors were encountered: