react-mathquill icon indicating copy to clipboard operation
react-mathquill copied to clipboard

Creating custom embedded objects

Open asianvader opened this issue 2 years ago • 0 comments

Hello, I'm currently converting an old project from JavaScript/jQuery to React/Typescript and I have custom embedded objects (https://docs.mathquill.com/en/latest/Api_Methods/#registerembedname-functionid-return-options-x). I don't know if I can access the .registerEmbed method using the react-mathquill wrapper? This was an experimental MathQuill feature.

Here's an example of the implementation from the old project:

MQ.registerEmbed("br", function registerBr() {
    return {
      htmlString: `<div class="mq-br"></div>`,       
      text: function text() {
        return "mq_br";
      },
      latex: function latex() {
        return "\\mqBr";
      },
    }
  });

Thank you.

asianvader avatar Sep 12 '23 16:09 asianvader