Skip to content

Title: Bug: H5P.MathDisplay-1.0 not working – MathJax(input/mml): Can't load error after HTML export #4225

@ThomasG26

Description

@ThomasG26

Bug: H5P.MathDisplay-1.0 not working – MathJax(input/mml): Can't load error after HTML export


Describe the bug

I'm encountering a problem when using the @lumieducation/h5p-html-exporter package and createBundleWithExternalContentResources function.
After exporting an H5P package that uses the H5P.MathDisplay-1.0 library, the generated HTML throws the following error in the browser console:

MathJax(input/mml): Can't load "data:application/javascript;base64,Lyo....[base64 js]Qocik/input/mml.js"

As a result, Math formulas are not rendered correctly.


To Reproduce

Steps to reproduce the behavior:

  1. Use an H5P content type that includes math (e.g. using MathML or LaTeX).
  2. Ensure H5P.MathDisplay-1.0 is included in both the player and editor configurations as an addon.
  3. Use @lumieducation/h5p-html-exporter to generate an HTML export of the content.
  4. Open the exported HTML file in the browser.
  5. Check the console – the MathJax loading error appears, and math rendering fails.

Expected behavior

Math equations should be rendered properly using MathJax in the exported HTML, just like in the H5P player/editor environment.


Configuration

  • @lumieducation/h5p-html-exporter version: ^9.0.10
  • Node.js version : 18.12.0
  • Browser: Edge
  • OS: Windows 11 WSL Ubuntu 20.04

Additional context

  • H5P.MathDisplay is correctly registered in the addons config for both the editor and the player.
  • This issue only occurs with the exported HTML; everything works fine within the H5P player/editor.

Let me know if you need a minimal reproduction repo or the relevant configuration – happy to provide it.

Thanks for your work on the project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions