Skip to content

Fix nested MathJax loading and speech worker errors - #52

Merged
djmsampson merged 3 commits into
masterfrom
math_js
Dec 4, 2026
Merged

djmsampson merged 3 commits into
masterfrom
math_js

Conversation

@djmsampson

Copy link
Copy Markdown
Collaborator

Summary

  • Ensure nested generated pages load the MathJax configuration before the bundle, with each script included once from the generated resources folder.
  • Disable MathJax semantic enrichment through the contextual-menu settings. This prevents the bundled component from starting speech and braille processing that requires SRE worker assets DocMaker does not ship, while preserving visual TeX rendering.
  • Add a nested demo page with inline and display math, and register it in the MATLAB project.

Verification

  • MATLAB buildtool("check") passed, including project checks.
  • MATLAB MCP regenerated demo/sub/math.html and its resources.
  • Chrome verification confirmed inline and display math render, required resources load, and there are no speech-worker requests, failed requests, or Console errors.

Closes #51

The MathJax config also dynamically loaded the bundle through a bare relative URL. On nested pages, that URL resolved relative to the generated HTML page instead of the resources folder; if it resolved, the bundle could be loaded twice.

Keep the config limited to setting MathJax options and rely on docconvert's existing config-then-bundle script references, which use paths relative to each generated page. Add nested-page regression coverage for the resource paths, one bundle reference, and script order.

Test: MATLAB MCP run of tests/tdocconvert.m (3 passed, 0 failed).
Configure MathJax's contextual menu to disable semantic enrichment, which also gates speech and braille processing and avoids loading the unbundled SRE worker. Add a nested demo page with inline and display math for browser inspection.
Register the nested demo/sub/math.md fixture in the MATLAB project metadata so source-control project checks recognize the new file.
@djmsampson
djmsampson merged commit 3882f7c into master Dec 4, 2026
14 checks passed
@djmsampson
djmsampson deleted the math_js branch December 4, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load the MathJax bundle once from the generated resources path

1 participant