[TW5] Katex-Plugin: static html export does not work properly

126 views
Skip to first unread message

Hans Mürter

unread,
Jul 13, 2015, 4:15:30 PM7/13/15
to tiddl...@googlegroups.com
Hi,

static html export of tiddlers with latex-code does not work properly when using the katex-plugin:

Scenario:
1.) activate KaTeX-plugin (via Official TiddlyWiki Plugin Library)
2.) create new tiddler, with latex/katex-content, e.g. $$a^2+b^2=c^2 $$
3.) use "export tiddler"->"static HTML"  to save this tiddler as static html

Result when opening the exported static html-file:
At each place of a katex-formula $$ ....$$, we get an error message displayed in red: "TypeError: setting a property that has only a getter"

Error-Tracking reveals an entry in the static html-file as follows:
 
<div class="tc-tiddler-body"><p><span class="tc-error">TypeError: setting a property that has only a getter</span></p></div>
 
which seems a rendering error during export.


Unfortunately I don't have much experience with CSS/html, can anyone help me finding out a solution for proper static html export with katex-plugin?


Jeremy Ruston

unread,
Jul 16, 2015, 7:38:21 AM7/16/15
to TiddlyWiki
Hi Hans

Thanks very much for the report, I've pushed a fix for 5.1.10:


You can try it out using the prerelease, but please don't start using the prerelease for your regular work; we've had people lose data in that way in the past.


Best wishes

Jeremy


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ffba2227-7a1f-43be-93d9-af9c34050420%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Hans Mürter

unread,
Jul 16, 2015, 1:57:01 PM7/16/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy,

thanks for the quick fix, static html-export works fine with the changes. The PreRelease has Katex disabled by default and "Get more Plugins" points to the current released katex-plugin version 5.1.9 - so I just edited the ShadowTiddler $:/plugins/tiddlywiki/katex/wrapper.js / according to your changes.

A slight drawback occurs with enabled "show preview" in editing mode: Due to an unfinished formula the user is notified by an internal javascript-error-popup.
Using the "try-catch"-construct (I just removed the comment / reactivated the original code in line 39 and lines 45-48) works as a quick fix for me. Unfinished formulas are then rendered as a parse-error within the preview.

TiddlyWiki works like a charm, thanks for your great deal of work, Jeremy!

Jeremy Ruston

unread,
Jul 17, 2015, 3:46:46 AM7/17/15
to Hans Mürter, TiddlyWiki
Hi Hans

Good catch, I've fixed those two oversights:

* Updated the version number of the plugin library to 5.1.10
* Re-enabled the error trapping for formulae rendering

I've uploaded a new prerelease for you to try:
Reply all
Reply to author
Forward
0 new messages