Moodle
  1. Moodle
  2. MDL-25565

Superscript rendering in moodle 2.0

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.3
    • Component/s: Themes
    • Labels:
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      6583

      Description

      The superscript is not aligned properly. I overrode the default settings with

      sup

      {font-size: .83em;line-height: 0.5em;vertical-align: baseline;position: relative;top: -0.4em;}

      sub

      {font-size: .83em;line-height:0.5em;vertical-align: baseline;position: relative;top: 0.4em;}

      in the general.php of the theme. The difference is clearly seen in the figures. sup1.gif is rendering in moodle.org forum and sup.gif is after adding sup directive.

      1. sup.gif
        3 kB
      2. sup1.gif
        3 kB

        Issue Links

          Activity

          Hide
          Mauno Korpelainen added a comment -

          This looks like a terrible bug in yui reset.min.js that sets

          sup

          {vertical-align:text-top;}

          sub

          {vertical-align:text-bottom;}

          I think the best fix would be to use in base theme css

          sup

          {vertical-align:super;}

          sub

          {vertical-align:sub;}

          to oevrride yui reset code for sub and sup.

          This is supported by all browsers and it is the default behaviour of browsers for superscript and subscript.

          Current yui reset code fails miserably if you try to use tags like 2<sup>3<sup>4</sup></sup> which should render two to the power of 3 to the power of 4 but yui reset code renders it as 2 to the power of 34

          Show
          Mauno Korpelainen added a comment - This looks like a terrible bug in yui reset.min.js that sets sup {vertical-align:text-top;} sub {vertical-align:text-bottom;} I think the best fix would be to use in base theme css sup {vertical-align:super;} sub {vertical-align:sub;} to oevrride yui reset code for sub and sup. This is supported by all browsers and it is the default behaviour of browsers for superscript and subscript. Current yui reset code fails miserably if you try to use tags like 2<sup>3<sup>4</sup></sup> which should render two to the power of 3 to the power of 4 but yui reset code renders it as 2 to the power of 34
          Hide
          Mauno Korpelainen added a comment -

          I mean reset-min.css (not reset.min.js)

          Show
          Mauno Korpelainen added a comment - I mean reset-min.css (not reset.min.js)
          Hide
          Mauno Korpelainen added a comment -
          Show
          Mauno Korpelainen added a comment - See http://moodle.org/mod/forum/discuss.php?d=163685 for more details
          Hide
          Sam Hemelryk added a comment -

          Bumping this up to major.

          Show
          Sam Hemelryk added a comment - Bumping this up to major.
          Hide
          Mary Evans added a comment -

          Well it looks like this might be my next PULL request Sam!

          Show
          Mary Evans added a comment - Well it looks like this might be my next PULL request Sam!
          Hide
          Helen Foster added a comment -

          It would be great if you could fix this Mary!

          Show
          Helen Foster added a comment - It would be great if you could fix this Mary!
          Hide
          Mary Evans added a comment -

          Hi Helen, There is another ticket MDL-25434 about the same issue. Is there a way to merge these two tickets? That way I can clear both then at the same time. Thanks!

          Show
          Mary Evans added a comment - Hi Helen, There is another ticket MDL-25434 about the same issue. Is there a way to merge these two tickets? That way I can clear both then at the same time. Thanks!
          Hide
          Helen Foster added a comment -

          Hi Mary,

          You can merge two issues by linking them. Select 'Link' from the More Actions dropdown menu above then choose "Duplicated", "Will be resolved by" etc. as necessary.

          Show
          Helen Foster added a comment - Hi Mary, You can merge two issues by linking them. Select 'Link' from the More Actions dropdown menu above then choose "Duplicated", "Will be resolved by" etc. as necessary.
          Hide
          Mary Evans added a comment - - edited

          MDL-25434 is now linked to MDL-25565 since both have one and the same problem.

          Show
          Mary Evans added a comment - - edited MDL-25434 is now linked to MDL-25565 since both have one and the same problem.
          Hide
          Mary Evans added a comment -

          I've added a PULL request for this issue, so hopefully it should be fixed in the next weekly update. I think it was committed too late for this weeks!

          Show
          Mary Evans added a comment - I've added a PULL request for this issue, so hopefully it should be fixed in the next weekly update. I think it was committed too late for this weeks!
          Hide
          Helen Foster added a comment -

          Mary, thanks for fixing this issue. The fix is available in this week's 2.0.2+.

          Show
          Helen Foster added a comment - Mary, thanks for fixing this issue. The fix is available in this week's 2.0.2+.
          Hide
          Mary Evans added a comment -

          Thank you Helen!

          Show
          Mary Evans added a comment - Thank you Helen!

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: