The latest git version of Sigil now includes the ability to clone, patch, configure and install a working version of libxml2 alongside Sigil (does not affect the system version of libxml2). To enable it, just add the -DBUILD_PATCHED_LIBXML2=1 option to the initial cmake configuration command.

From the documentation:

Quote:

-DBUILD_PATCHED_LIBXML2=(0|1) Some newer versions of libxml2 have a bug that causes QtWebKit to render html entities twice. Adding -DBUILD_PATCHED_LIBXML2=1 to the cmake command will clone the libxml2 git repo, checkout a specific commit, patch the source, build it and install it alongside Sigil (does not affect the system version of libxml2). Requires git, libtool, autoconf and automake packages to be installed (as well as a working internet connection). Cmake should notify of any missing programs needed. The default is to NOT build the patched version of libxml2 (-DBUILD_PATCHED_LIBXML2=0).

FYI, as far as I know, libxml2 is an optional dependency of WebKit, you can compile WebKit without it. That will mean that WebKit wont have support for XSLT, but I doubt that is used anywhere Sigil cares about.

AFAIK, it is used by webkit to evaluate named entities which we allow in the source and also to process as you say xslt transformations which are used inside MathJax to handle some of the extended mathml.

So disabling it means a few specific mathml elements will not show properly in Preview.

See this bug report for mml3.js not working on builds of Qt without libxml2

The bug is really going to affect those Linux users who:
a) Build Sigil themselves on a system with libxml2 2.9.3 or higher.
b) Install Sigil from a repo on a system with libxml2 2.9.3 or higher.

Those numbers are probably pretty small right now, but those going with method B) are only going to grow more numerous. Their only hope is that Ubuntu patches libxml2 (or that libxml2 gets fixed very quickly), or this workaround.

If I can ever get a Linux installer package together that I have a high degree of confidence in, I'll of course include a patched version of libxml2 in it. But I was really hoping the repo version would gain traction and make that step unnecessary.

Those using method A) will soon have an option to build/include a patched version of libxml2 while compiling Sigil themselves. I hope anyway ... a few more kinks to work out.

@KevinH: I'm fairly certain that when libxml2 is absent, webkit uses something else to evaluate named entities. Named entities are common enough that is that were not the case, there would be hundreds of bug reports against Qt WebKit on windows, since as far as I know, Qt WebKit has never linked against libxml2 on windows.

According to the bug report filed at libxml2 by Apple, it is used by webkit, but if you can build it without, then they must have an alternative way of handling it. Either way, the mml3.js MathJax extension needs xslt for some mathml element support.

And you are right none of those mathml elements work on Windows, and thus the bug report I filed with mathjax to eliminate the use of xslt.

I got excited to see a new patched version of libxml2-2.9.4 come down the pipe on Arch Linux (2.9.4+0+gbdec218-2 -> 2.9.4+4+g3169602-1), but alas ... it doesn't resolve this issue. It's just a couple of cherry-picked commits from the official libxml2 git repo made since 2.9.4's release.

The latest git version of Sigil now includes the ability to clone, patch, configure and install a working version of libxml2 alongside Sigil (does not affect the system version of libxml2). To enable it, just add the -DBUILD_PATCHED_LIBXML2=1 option to the initial cmake configuration command.

From the documentation:

Quote:

-DBUILD_PATCHED_LIBXML2=(0|1) Some newer versions of libxml2 have a bug that causes QtWebKit to render html entities twice. Adding -DBUILD_PATCHED_LIBXML2=1 to the cmake command will clone the libxml2 git repo, checkout a specific commit, patch the source, build it and install it alongside Sigil (does not affect the system version of libxml2). Requires git, libtool, autoconf and automake packages to be installed (as well as a working internet connection). Cmake should notify of any missing programs needed. The default is to NOT build the patched version of libxml2 (-DBUILD_PATCHED_LIBXML2=0).

Libxml2 has finally been updated to fix this regression bug. It should make it into libxml2 v2.9.5 at the very latest. But I'm hoping some distros cherry-pick the official commit before that! (I'm lookin' at you Arch ).