Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-17021

diff.css velocity breaks on colors written with 3 characters

    Details

    • Development Priority:
      High
    • Difficulty:
      Easy
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      When the color used in diff.css which is coming from the color theme is written with 3 chars instead of 6 (#fff instead pf #ffffff) then the diff.css velocity fails and the whole diff display is broken (including hidden unchanged items in the rendering view).

      The code is there
      https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/uicomponents/viewers/diff.css

      The problematic code is:
      #set ($red = $integer.parseInt($hexColor.substring(1,3), 16))
      #set ($green = $integer.parseInt($hexColor.substring(3,5), 16))
      #set ($blue = $integer.parseInt($hexColor.substring(5), 16))

      Since #fff is allowed this should be handled and we should even fallback to standard behavior if the color we get is completely wrong.

        Attachments

          Activity

            People

            • Assignee:
              mflorea Marius Dumitru Florea
              Reporter:
              ludovic Ludovic Dubost
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: