Coder Social home page Coder Social logo

Comments (7)

liffiton avatar liffiton commented on July 25, 2024

What browser are you using, and on what platform? In Firefox on Windows, I actually get javascript errors when hovering a footnote with math, and it doesn't display at all. I'll need to look into that more, but I'd like to try to reproduce your symptom as well.

from dokuwiki-plugin-mathjax.

msakuta avatar msakuta commented on July 25, 2024

Confirmed in Chrome on Windows 10. Apparently Chrome does not show any error on debugger console.

Also checked Microsoft Edge on Windows 10. It does not show popup window at all when I hover the cursor on the footnote link (I guess it's the same response as your Firefox). Its debugger outputs error "SCRIPT1014: Invalid character" at js.php (3,2613).

image

from dokuwiki-plugin-mathjax.

liffiton avatar liffiton commented on July 25, 2024

Thanks. The javascript error is almost certainly a bug in Dokuwiki (the script shouldn't crash based on the contents of a footnote), so that might take some time and a Dokuwiki bug report to fix. I'll try to look into it in the next few days, though. And I'm guessing the Chrome issue is somehow related, but I'll look to see if there is something different going on there as well.

from dokuwiki-plugin-mathjax.

liffiton avatar liffiton commented on July 25, 2024

It looks like it's an interaction between Mathjax and jQuery, actually. When Mathjax parses a math formula, it replaces it with the markup to render it and creates a <script> tag of type "math/tex" with the original text of the formula. When Dokuwiki shows a footnote popup, it grabs whatever is in corresponding footnote at the bottom of the page and adds it to a new <div> using jQuery. JQuery sees the <script> tag and tries to execute it, not "realizing" that it isn't actually javascript. The error occurs and the footnote display code doesn't complete.

I don't believe there is anything reasonable that I can do in the plugin to correct this. Unfortunately, I'm not sure whether it can be fixed in Dokuwiki, or if it is an issue with jQuery or even with Firefox. I'll keep looking into it a bit, but I can't promise much.

Meanwhile, for me in Chrome, the footnote popups display with incorrect rendering, as you showed, but the different renderers give different types and levels of incorrect. If I switch Mathjax to render with the "SVG" renderer, though, the footnote popup displays correctly for me in Chrome.

So that may be the best workaround I have right now: Use Chrome and set Mathjax's renderer to SVG.

from dokuwiki-plugin-mathjax.

liffiton avatar liffiton commented on July 25, 2024

Ah, I think I found it. It looks like a bug in Dokuwiki. When it's pulling the contents of the footnote to create the popup, it mangles them intentionally but incorrectly... If I'm understanding this correctly, I should be able to submit a bug report to Dokuwiki soon.

from dokuwiki-plugin-mathjax.

liffiton avatar liffiton commented on July 25, 2024

See the referenced dokuwiki bug for a fix (editing one line in lib/scripts/page.js).

Thanks for the really clear bug report, by the way.

from dokuwiki-plugin-mathjax.

msakuta avatar msakuta commented on July 25, 2024

Yup, the solution in the referenced DokuWiki issue worked for me. I only tested Firefox and IE11 but I don't think Chrome will have an issue. (I'll check later when I'm home.)

Thank you and I appreciate this issue is addressed so quickly.

Edit: Chrome worked, too.

from dokuwiki-plugin-mathjax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.