Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-18486

An end BODY html tag in a macro output causes Confluence to stop rendering the Page

    XMLWordPrintable

Details

    Description

      If a macro outputs html with a end BODY tag (ie </body>) then this causes Confluence to stop rendering the Page (the editable part).

      This is very easy to reproduce. I just now created a new macro using the guide here:

      http://confluence.atlassian.com/display/DEVNET/Developing+your+Plugin+using+the+Atlassian+Plugin+SDK

      ie using the atlas-create-confluence-plugin command. I then simply modified the execute-method like this:

      public String execute(Map params, String body, RenderContext renderContext)
      throws MacroException
      {
      String returnString = (String) params.get("return");
      if (returnString != null && returnString.equals("no-end-body"))

      { return "no-end-body"; }

      if (returnString != null && returnString.equals("end-body"))

      { return "end-body</body>"; }

      throw new MacroException("You must specify the parameter 'return', with a value of 'no-end-body' or 'end-body'.");
      }

      When I created the macro I gave it the name 'bugtest'. And to test this macro in action I just type this at the top of the DEMO Space page:

      {bugtest:return=end-body}

      And when I view the page everything below my macro output is gone, except the normal footer with Labels, Children etc. Now, I can only assume that this shouldn't happen.

      If I change the parameter like this:

      {bugtest:return=no-end-body}

      then all is fine, ie below my macro output is there, ie the welcoming text and balloon picture etc.

      I have also attached my entire macro as a deployable zip file.

      Attachments

        Activity

          People

            Unassigned Unassigned
            32036d8aea08 Jimi H
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: