jsMath and IPB

  • Patrick

    Patrick - 2007-09-25


    I wanted to use jsMath in my Invision Power Board, but the only thing is IPB converts \ to its HTML entity (& #092;). A good thing, when you look at what someone could do by using \ (having a poster closing a <div> and your layout looks... quiet different), but it's also very necessary when using TeX. Is there a way to get jsMath to parse & #092; as if it were \?

    Thanks in advance,


    • Davide P. Cervone

      My tests all show that jsMath already DOES handle this entity name properly.  Can you tell me what version of jsMath you are using, and what browser you are testing it from?  Can you send a snippet of the HTML that is being produced by IPB that includes some mathematics (and a bit of surrounding text)?


      PS, note that to end a <DIV> tag, you would need to use / not \ as it is </DIV> not <\DIV>.  In any case, if the users can enter tags, they can mess up the display without needing /, as they could add EXTRA <DIV> tags, for example, which would be just as damaging.  IPB probably converts \ to an entity because \ is used by whatever language underlies it as a special character in strings and it is trying to avoid having it change the meaning of the following character (or characters) accidentally.

    • Patrick

      Patrick - 2007-09-26

      You are truly right about the \-thingy! I downloaded jsMath a few days ago, and it should be 3.4d. Just to be sure, I re-uploaded the files.

      It seems to work on a less big piece of HTML nicely (I've tried it out on the next piece of HTML too:

      <script type="text/javascript" src="extras/jsMath/easy/load2.js"></script> <!--a modified file,not to use for all users on the host-->
      <div class="tex2math_ignore">
      This is a tryout and this should still be text! <div class="math">a \vee &#92;neg a = &#092;top</div>
      <span class="tex2math_process">
      However, this should be processed:  <div class="math">a \vee &#92;neg a = &#092;top</div>

      but there it worked in both cases, also in the case where tex2math_ignore should prohibit it from doing so. Tested on Firefox at Linux and Windows, and on Internet Explorer ).

      Although, when I use it on a larger piece (710 lines, 33.4 KB) which has, when you only look at the tags which should matter to jsMath, a more simpler content (removed the tags with class="tex2math_ignore" and class="tex2math_process". Whole generated page available at http://wumpwump.nl/might_be/working.html (the jsMath related tags appear at lines 18 and 347)
      Now when I got someone to check it on a Windows computer, it did work on Internet Explorer at Windows. However, it didn't work on Firefox at both Linux and Windows; the grey bar at the left lower corner keeps telling it's loading. How long you wait doesn't seem much of a factor; after more than an hour it's still loading.

      - Patrick

      • Davide P. Cervone

        OK, thanks for all the new information.  The fact that your static sample page works in Firefox (and I've checked in in IE7 and it works there, too), but doesn't work on the live site suggests that the difference between these two pages is the cause of the problem.  So we need to determine the differences between these pages.  One thing that I see right away is that most of the JavaScript from the page is NOT being loaded (because the "might_be" in the URL breaks the links to those files).  That means that one of those is probably conflicting with jsMath in some way.  You might try fixing the links to these (one at a time, there appear to be 9 of them) in your "might_be" file, and see which one causes jsMath to stop working.  Then we can check into that javascript to see what is causing the problem.

        I'll try to see what I can do from here, but it might harder for me since I don't have your full site.

        I have confirmed that you are using version 3.4d, so you have that correctly installed.

        Unfortunately, however, you have a misunderstanding of the way that tex2math_ignore works.  That ONLY controls the action of the tex2math plugin, not jsMath itself.  That plugin searches the HTML page for TeX and LaTeX math delimiters and converts them to <SPAN CLASS="math"> and <DIV CLASS="math"> so that jsMath will be able to process the TeX.  The tex2math_ignore marker only affects that translation process, not the action of jsMath.  Any SPAN or DIV marked as CLASS="math" with be processed by jsMath, which is what you are seeing.


    • Patrick

      Patrick - 2007-09-26

      Strangely, the copy of the not-working page in Firefox, is working. Could it be that jsMath should be loaded as last script, after the Javascript of the forum?

      • Davide P. Cervone

        It's possible that loading jsMath last might help, but we will no better once we figure out which javascript file it is in conflict with.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks