Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#28 Line Break issues

v3.6c
closed-fixed
nobody
5
2010-03-17
2010-03-15
ssp
No

When running in WebKit based browsers (Safari, Chrome [Firefox 3.6 seems OK, but in some earlier versions the same problem seemed to exist]), it frequently happens that line breaks are don incorrectly when jsMath is used.

In those cases the jsMath formula is displayed on the first line (extending into the margin) while there is blank space reserved for it at the beginning of the second line. I attach an example page to illustrate this. (Said pages comes from jsMath used inside the ILIAS e-learning system which is somewhat convoluted, so it's hard to tell what exactly causes this problem to appear.)

Discussion

  • ssp
    ssp
    2010-03-15

    HTML of the example

     
    Attachments
  • ssp
    ssp
    2010-03-15

    PDF Version of the example with the problem highlighted

     
    Attachments
  • Thanks for the bug report. I have a solution for the problem that will be included in the next release of jsMath (I hope to have it out shortly).

    Davide

     
    • milestone: --> v3.6c
    • status: open --> closed-fixed
     
  • ssp
    ssp
    2010-03-17

    Cool, thanks. Once it's out, I'll just have to get our people to install it then.

    Can you give a hint whether this was a problem with jsMath's logic or rather with WebKit's rendering?

    In case it's the latter, I'd like to point Apple to it (I filed a bug report on this with them over a year ago, but as things go with Apple, I never heard back).

     
  • I released 3.6d this morning, so you should be ready to go.

    Well, the problem was the following: jsMath uses a zero-width box in which it uses absolute positioning to lay out the mathemtics (which sticks out to the right, usually), and then follows it by a box of the correct width, height, depth (once it knows what they are) so that the math appears to take up the right amount of space. The combination is placed within a <nobr>...</nobr> to prevent breaks, but apprently Safari (as well as some versions of Firefox) feel that they can break between the two jsMath boxes even within the <nobr> tag. I consider that a browser failure, not a jsMath failure, though the construct in jsMath is a bit fragile, and I would do it differently were I to do it today.

    I doubt it will do much good to report it, but if you do, I would not give them jsMath as an example, as it is too complicated for them to use as a test case. You would need to make a very simple test case with two <span> tags inside a <nobr> where a the browser inserted a line break between the two. Apparently, this is new in Safari 4 (it doesn't seem to occur in 3.2 or earlier).

    Davide

     
  • ssp
    ssp
    2010-03-17

    Thanks a lot for the info and the release!

    FWIW: I am fairly sure the problem existed in Safari 3 as well. I filed my report on this with Apple in August 2008 (presumably on Safari 3.1 or 3.2) and the line-break problems appeared quite consistently when I was using jsMath.

     
  • Well, I wasn't able to reproduce it in Safari 3, but I'm not certain that the mechanism used to run old versions of Safari is reliable for that type of thing. In any case, lets hope that people are upgrading to Safari 4. The jsMath v3.6d that I released this morning has the fix special-cased to version 4.

    Davide