Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"jquery": "^3.5.1",
"lodash.has": "^4.5.2",
"lodash.uppercase": "^4.3.0",
"mathjax": "^3.2.2",
"mathjax": "^4.0.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The MathJax configuration uses outdated v3-style properties (displayAlign, displayIndent, menuSettings) that are invalid in MathJax v4, causing rendering and functionality issues.
Severity: MEDIUM

Suggested Fix

Update the MathJax configuration in base-theme/layouts/partials/mathjax_if_necessary.html to match the v4 structure. Move displayAlign and displayIndent into an output object. Refactor the menuSettings configuration to use the options.menuOptions.settings structure. Verify and update errorSettings according to v4 documentation.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: package.json#L64

Potential issue: The upgrade to MathJax v4 introduces a compatibility issue with the
existing configuration in `base-theme/layouts/partials/mathjax_if_necessary.html`. The
configuration uses property structures from MathJax v3 that are invalid in v4.
Specifically, `displayAlign` and `displayIndent` are placed at the root level instead of
under the `output` object. Similarly, `menuSettings` is used at the root level, but v4
expects this configuration under `options.menuOptions.settings`. The `errorSettings`
option is also not a standard v4 root-level option. This structural mismatch will cause
MathJax to ignore these settings, leading to incorrect rendering alignment for
mathematical expressions and broken context menu functionality.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The webpack configuration for CopyWebpackPlugin references a non-existent MathJax v3 path (es5/) after the upgrade to v4, which will prevent math rendering.
Severity: CRITICAL

Suggested Fix

Update the from path in the CopyWebpackPlugin configuration within webpack.common.ts. The path should be changed from ./node_modules/mathjax/es5/ to the correct directory for MathJax v4 assets, which is likely the top-level package directory or a new bundle/ directory.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: package.json#L64

Potential issue: The project's webpack configuration, specifically the
`CopyWebpackPlugin` in `webpack.common.ts`, is configured to copy MathJax assets from
the `./node_modules/mathjax/es5/` directory. This path is correct for MathJax v3 but is
non-existent in MathJax v4, which this pull request upgrades to. This misconfiguration
will cause the build process to fail to copy necessary MathJax files. Consequently, at
runtime, the application will be unable to load the MathJax scripts, leading to a
failure in rendering any mathematical expressions on the site.

"nanogallery2": "^2.4.2",
"offcanvas-bootstrap": "^2.5.2",
"pdfobject": "^2.2.8",
Expand Down
19 changes: 14 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2581,6 +2581,13 @@ __metadata:
languageName: node
linkType: hard

"@mathjax/mathjax-newcm-font@npm:^4.1.1":
version: 4.1.1
resolution: "@mathjax/mathjax-newcm-font@npm:4.1.1"
checksum: 10c0/8fcddc81757b90f3141d1994222b92a04b44ad9ceb83c28638e59d31d5cfaf73e1cb26e4101cce15aee870036f8b68f10fab919e0db0e25eff8a39f249e688f2
languageName: node
linkType: hard

"@messageformat/core@npm:^3.0.1":
version: 3.4.0
resolution: "@messageformat/core@npm:3.4.0"
Expand Down Expand Up @@ -12417,10 +12424,12 @@ __metadata:
languageName: node
linkType: hard

"mathjax@npm:^3.2.2":
version: 3.2.2
resolution: "mathjax@npm:3.2.2"
checksum: 10c0/26c8557f948d1ef76ce2b0bc1ad66128c9a78a7e4f3d96587f90b23dd25cfbf14c9b58a1c75a7d8d35f92b72bab054eab61873443babe646b7bfd6b40bb717e6
"mathjax@npm:^4.0.0":
version: 4.1.1
resolution: "mathjax@npm:4.1.1"
dependencies:
"@mathjax/mathjax-newcm-font": "npm:^4.1.1"
checksum: 10c0/e2a861803d8a3ed3ae6ebf40f08c41bcdd1e9110392f43c94fea3f508cd647d9c8eb80b72dcc0653757d666e94b5fdc4aac74121f0f193f8bdd262106404822a
languageName: node
linkType: hard

Expand Down Expand Up @@ -13682,7 +13691,7 @@ __metadata:
jquery: "npm:^3.5.1"
lodash.has: "npm:^4.5.2"
lodash.uppercase: "npm:^4.3.0"
mathjax: "npm:^3.2.2"
mathjax: "npm:^4.0.0"
mini-css-extract-plugin: "npm:^2.6.1"
nanogallery2: "npm:^2.4.2"
offcanvas-bootstrap: "npm:^2.5.2"
Expand Down
Loading