Menu

#273 anchors and tooltips for sections with math in titles

workingwiki
open
None
5
2013-05-07
2013-03-08
Lee Worden
No

When a section heading includes some math, for instance

== The $$\phi=0$$ case ==

WW displays the math correctly in the heading itself, and in its entry in the page's table of contents. It leaves its internal token "UNIQ-WW-...-QINU" in the name of the HTML anchor and in the tooltip that appears when you hover over the edit link for the section. This is because those strings are stored as attributes in HTML tags - something like

<span id="The UNIQ-WW-84374873-QINU case">...</span> -

and you can't put a bunch of MathML markup in there without breaking the page. But this is unsightly and confusing (though the anchors do work). It should do something better.

Discussion

  • Lee Worden

    Lee Worden - 2013-03-08

    It would be great to put the original wikitext there, like

    <span id="The $$\phi=0$$ case">...</span>
    

    (with appropriate escaping, of course).

    I guess this would be a matter of sorting out what the parser makes the id and mw:editsection from, and doing something smart around replace_inlines() to get the un-expanded code in there, exempt from the transformation from $$...$$ to <source-file filename="ww-internal-whatever.tex" standalone=true>...</source-file>.

     
  • Lee Worden

    Lee Worden - 2013-03-08

    I wonder what the Math extension does about this?

    Since it only implements the <math>...</math> construct, maybe you just can't use it in section headings...

     
  • Lee Worden

    Lee Worden - 2013-03-08

    From another ticket:

    I could change "UNIQ-WW-*-QINU" into literally "..." in the section anchors and tooltips. But this would make the anchors non-unique, i.e. if you have sections "$$\phi=0.1$$", "$$\phi=0.2$$", etc., as the page where this bug appeared does have, the links in the TOC would all go to the first of these sections.

     

    Last edit: Lee Worden 2013-03-08
  • Lee Worden

    Lee Worden - 2013-03-08

    Maybe I could get replace_inlines() to run a bit later, like after the parser makes the anchors and mw:editsections, and do the expansion only in the appropriate places...

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.