TW 5.3.0 JS exception

Hi,

I recently attempted to upgrade my TW from 5.2.3 to 5.3.0. After upgrading (without errors) I get an exception closing a tiddler. I made a minimal example below. This is a fresh 5.3.0, with just a MathJax plugin I use and two tiddlers. All you need to do is open “Pipe Area” and close it.

http://www.scss.com.au/family/andrew/tiddlywiki/tw-5.3.0-test.html

I checked with the latest Chrome, Edge and Firefox.

Is this an issue with TW or the plugin? Any advice?

Also, the “TiddlyWiki Releases” tiddler on the main TW site refers to Releases · Jermolene/TiddlyWiki5 · GitHub which is empty. I was hoping to find some older blank versions of TW to narrow down what version introduced this issue.

Cheers,
Andrew

Hi Andrew,

I can reproduce the problem with a very fast check. There seems to be a “clean up” problem, when the tiddler is closed and the DOM elements are removed.

It’s super funny. It seems as if the $s$ at the beginning of the line does not have a parent DOM element, which causes the problem.

If I disable the plugin and change the text to the following, it does not cause the problem, when the plugin is active again. I know, that’s not a solution just a finding.

* . $s$ will be a site-specific constant and so $A_(SEG)("diameter"/2,s)$ can be calculated once and re-used

More investigation is needed. May be later today evening.


Do you have to use this mathjax library?

Would it be possible to use the official TW kaTex plugin instead?

I know the syntax is probably slightly different. But kaTeX is supported by the core and does not need an online connection.

-m

1 Like

Thank you @andrewg_oz I’ve pushed a fix here -Robustify widget.removeLocalDomNodes · Jermolene/TiddlyWiki5@29b5b06 · GitHub. It will be available for testing at https://tiddlywiki.com/prerelease in a few minutes

The problem is that the MathJax plugin operates by modifying the DOM nodes that TiddlyWiki creates. That approach works OK for a static site but creates problems in a dynamic setting like TiddlyWiki because from TiddlyWiki’s point of view, DOM nodes that it has created have been spontaneously corrupted.

As @pmario says, I’d strongly advise switching to the core KaTeX plugin if you’re able to.

2 Likes

Thanks guys.

I had looked at the KaTeX plugin before, but it seemed a lot less friendly than the AsciiMath that MathJax supports (and AsciiMath seems much more in the spirit of tiddlywiki than KaTeX).

I notice that the KaTeX site links to an AsciiMath to TeX converter, so I’ll see if I can use that to convert my formulas and switch to KaTeX.

Thanks again.

I use Muuri and Muuri Kanban plugin. Its given me also a JS exceptions in V5.3.0. It this related to this?

Just a note to say, that same fix also fixed my RSOD here: [BUG] RSOD Saving a Tiddler with tag $:/tags/Macro · Issue #7589 · Jermolene/TiddlyWiki5 · GitHub

I’ve just updated my page. I’ve combined the KaTeX parser tiddler and the AsciiMath conversion code into one (“AsciiMath Parser”). I suspect it wouldn’t be hard to put into KaTeX itself.

The short of it is that I only need to change “$asciimath-here$” to “$am$asciimath-here$$”.

The second most difficult part after that was figuring out how to reduce the minimum 3 character search length requirement to 1 so I could search my wiki for just a “$” to find those tiddlers where I used the original syntax.

Anyway, my wiki has now been converted to KaTeX, with minimal effort.

Thanks again.

1 Like