Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-448

Cannot use Macros as the source for an image

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Won't Fix
    • Major
    • None
    • 7.4.1, 7.4.2
    • Macro
    • None
    • N/A
    • N/A

    Description

      Steps to reproduce

      Create the page /Main/Target with the following page contents

          http://the-toast.net/wp-content/uploads/2015/07/Futurama_fry_looking_squint2.jpg
      

      Create the page /Main/Test with the following content:

          {{include reference="Main.Target.WebHome" /}}
      
          image:http://the-toast.net/wp-content/uploads/2015/07/Futurama_fry_looking_squint2.jpg
      
          image:{{include reference="Main.Target.WebHome" /}}
      

      Expected

      Line 1: the page contents of the page Main.Target.WebHome
      Line 2: the image at URL http://the-toast.net/wp-content/uploads/2015/07/Futurama_fry_looking_squint2.jpg displayed on the page
      Line 3: the image at URL http://the-toast.net/wp-content/uploads/2015/07/Futurama_fry_looking_squint2.jpg displayed on the page

      Actual

      Line 1 (WORKING AS EXPECTED): the page contents of the page Main.Target.WebHome
      Line 2 (WORKING AS EXPECTED): the image at URL http://the-toast.net/wp-content/uploads/2015/07/Futurama_fry_looking_squint2.jpg displayed on the page
      Line 3 (BROKEN): a broken image, with the source as { { include and the text reference="Main.Target.WebHome / } } immediately following the broken image

      Thoughts

      As far as I can tell, the image: syntax token has a higher order of operations than the {{ }} macro syntax token. Therefore, the opening of the macro, up until the first space is counted as being part of the image declaration rather than being associated with the macro. The macro should have higher precedence in the syntax tree and get evaluated before being used as a source for the image tag.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            fperedo Francisco Peredo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: