svgtex icon indicating copy to clipboard operation
svgtex copied to clipboard

"fixes duplicate xlink attribute on svg result" broke svgtex on Linux

Open stroobandt opened this issue 9 years ago • 9 comments

This "fix" has caused a major regression and rendered svgtex completely useless on GNU/Linux (Xubuntu LTS 14.04). On all my browsers (Firefox, Chrome, etc.), I now only see one or more horizontal lines instead of any formula. Reverting that commit fixes the problem.

stroobandt avatar May 15 '15 22:05 stroobandt

@serge-stroobandt , can you try the math expression xe for me (the two characters, no quotes)? That was my test case which continues to fail for me with Firefox and Chrome on Mac. Other equations render fine. I appreciate it if you can help me narrow the problem down.

tiarno avatar May 16 '15 20:05 tiarno

For reference, this is the follow-on to this pull request, right? The commit in question has already been reverted in master, and this issue is about fixing the problem such that it doesn't break anything else?

FWIW, I know that when I worked on this recently, I found it necessary to pull in the "fix" in question.

Klortho avatar May 18 '15 02:05 Klortho

Yes, that's the pull-request that was reverted. I worked on it this weekend and have had no success at all:

  • Without the fix I get 100% failure of the svg to display because of the duplicated hrefs.
  • With the fix I have not seen any failure.

So while I'm glad serge has success without the fix, I can't seem to do anything without it. I have the fix in my own fork so I can continue working with that.

tiarno avatar May 18 '15 13:05 tiarno

Well, I have to say, I think reverting the fix in master was a bad idea. I remember that I only needed this fix when I upgraded to the latest phantomjs (2.0.0). @serge-stroobandt , is it possible that it's related to the phantomjs version number rather than the platform?

Klortho avatar May 18 '15 14:05 Klortho

tested on Windows, same results--it must have the revereted fix in order to render the SVG. This is on Win7 now, with phantomjs 2.0.0. Will check phantomjs version later on the mac tonight. The error I continue to get is ::

 Attribute xlink:href redefined

Just a guess that earlier versions of webkit or phantomjs were more lenient.

tiarno avatar May 18 '15 20:05 tiarno

okay, I installed phantomjs 1.9.8 and get success with the master branch of svgtex.

This isn't my project so I don't mean to presume, but what about creating a new branch for phantomjs_pre2.0 (without the fix) and one for the current phantomjs that includes the fix?

tiarno avatar May 19 '15 13:05 tiarno

+1

Klortho avatar May 19 '15 14:05 Klortho

I don't like the solution with two branches.

Why wouldn't we inform the client (engine.js) which version we are running by calling http://phantomjs.org/api/phantom/property/version.html

at the beggining of the function listenLoop https://github.com/agrbin/svgtex/blob/baacbe9c990fd8d73f357e849acae92c4ed8b23e/main.js#L302

and notifying this information to client with something like: window.engine.setVersion

Then, the fix can be applied or not based on on the current phatnomjs version. It seems like 3 added lines, what do you think?

On 19 May 2015 at 16:42, Chris Maloney [email protected] wrote:

+1

— Reply to this email directly or view it on GitHub https://github.com/agrbin/svgtex/issues/15#issuecomment-103530073.

agrbin avatar May 19 '15 19:05 agrbin

I like it very much. Better than two branches for sure.

tiarno avatar May 19 '15 23:05 tiarno