html-editor-enhanced icon indicating copy to clipboard operation
html-editor-enhanced copied to clipboard

[FEATURE] How can we add the MathJax support for mobile devices?

Open shobhit-fliplearn opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. How can we add the MathJax support for mobile devices?

Describe the solution you'd like For starters, View only support for MathJax will also work.

Additional context Really stuck into this one, Please help!!!!

shobhit-fliplearn avatar Oct 18 '21 10:10 shobhit-fliplearn

HtmlEditor(
  controller: controller,
  htmlEditorOptions: HtmlEditorOptions(
    initialText: r"""Look at this: \(ax^2 + bx + c = 0\) \(\sqrt{x}\)""",
    darkMode: false,
  ),
  callbacks: Callbacks(onInit: () {
    controller.editorController!.evaluateJavascript(source: """var script = document.createElement('script');
          script.src = 'https://polyfill.io/v3/polyfill.min.js?features=es6';
          document.head.appendChild(script);
          var script2 = document.createElement('script');
          script2.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js';
          script2.async = true;
          document.head.appendChild(script2);""");
  }),
),

I didn't test this, but it should do the trick. Very similar to Web implementation, we just have to change how the javascript code is injected.

tneotia avatar Oct 18 '21 22:10 tneotia

Hopefully this answer helped you, closing the issue for now. If you have any other questions let me know!

tneotia avatar Oct 30 '21 16:10 tneotia

Hi First of all I would really like to thank you for this wonderful package. It has really helped me a lot. For the issue raised, I didn't get a chance to use the above mentioned solution. Will definitely let you know once I will try to implement the same.

Thanks & Best Regards Shobhit Shukla

On Sat, 30 Oct, 2021, 9:36 pm Tanay Neotia, @.***> wrote:

Hopefully this answer helped you, closing the issue for now. If you have any other questions let me know!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tneotia/html-editor-enhanced/issues/152#issuecomment-955393347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQTQ36HYKVFFYJVQ6OJSZHTUJQJXJANCNFSM5GGI56RQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

shobhit-fliplearn avatar Oct 30 '21 19:10 shobhit-fliplearn

Hi I tried the above solution. It's not working. Same behaviour as before. Thanks.

On Sat, Oct 30, 2021 at 9:36 PM Tanay Neotia @.***> wrote:

Hopefully this answer helped you, closing the issue for now. If you have any other questions let me know!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tneotia/html-editor-enhanced/issues/152#issuecomment-955393347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQTQ36HYKVFFYJVQ6OJSZHTUJQJXJANCNFSM5GGI56RQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

shobhit-fliplearn avatar Nov 12 '21 07:11 shobhit-fliplearn