Skip to content
Discussion options

You must be logged in to vote

You need to extend the toHTML method

editor.Components.addType('you-custom-component', {
  model: {
    // ...
    toHTML(opts) {
      const someProp = this.get('someComponentProp');
      const domAttributes = this.getAttrToHTML();
      const innerHtml = this.getInnerHTML(opts);
      // ..
      return `<div>My custom HTML</div>`
    }
  },
});

Additionally, I was considering whether it's possible to insert my inline JS just before closing the body tag. Can this be done?

Same thing as above, you need to extend the wrapper component.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@banderovskyi
Comment options

@artf
Comment options

artf Feb 17, 2024
Maintainer

Answer selected by banderovskyi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants