Uploaded image for project: 'Confluence Source Editor Plugin'
  1. Confluence Source Editor Plugin
  2. SOURCE-62

Lines with 1 character prevent the source editor from opening.

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 1.0.2
    • 1.0
    • None
    • Confluence 4.2 on Tomcat, Windows Server 2008 R2, Java version 1.7.0

    • true

      I was able to open several of my pages in the new source editor, but I have one that always gives me error 500. It is an admin changelog that I maintain to keep track of what I've done with the confluence installation. It has a bunch of H1 headings, and several code block macros. Otherwise, it's just text.

        1. editor markup.txt
          4 kB
        2. thread dump.txt
          19 kB

            [SOURCE-62] Lines with 1 character prevent the source editor from opening.

            Petch (Inactive) added a comment - - edited

            Changed how indenting was performed to avoid error with short lines (and the potential to break CDATA / pre content).

            Also fixed issue with <br/> <hr/> being rendered as HTML tags (i.e. not self-closing).

            Petch (Inactive) added a comment - - edited Changed how indenting was performed to avoid error with short lines (and the potential to break CDATA / pre content). Also fixed issue with <br/> <hr/> being rendered as HTML tags (i.e. not self-closing).

            There's a bug in the formatter, that for any line length 1 there's an array index error (it tries to read the 1st 2 characters but only does an empty line check).

            Will fix and release 1.0.2.

            Petch (Inactive) added a comment - There's a bug in the formatter, that for any line length 1 there's an array index error (it tries to read the 1st 2 characters but only does an empty line check). Will fix and release 1.0.2.

            Thanks Jason.

            Narrowed down further to the following markup:

            <p><br></p><table class="wysiwyg-macro" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGl0bGU9Q3VzdG9tIEhUTUwgYXQgdGhlIGVuZCBvZiB0aGUgYm9keXxsYW5ndWFnZT1qYXZhc2NyaXB0fGNvbGxhcHNlPXRydWV9&amp;locale=en_GB&amp;version=2); background-repeat: no-repeat;" data-macro-name="code" data-macro-parameters="collapse=true|language=javascript|title=Custom HTML at the end of the body" data-macro-body-type="PLAIN_TEXT" data-mce-style="background-image: url('https://confxhtml.atlassian.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGl0bGU9Q3VzdG9tIEhUTUwgYXQgdGhlIGVuZCBvZiB0aGUgYm9keXxsYW5ndWFnZT1qYXZhc2NyaXB0fGNvbGxhcHNlPXRydWV9&amp;locale=en_GB&amp;version=2'); background-repeat: no-repeat;"><tbody><tr><td class="wysiwyg-macro-body"><pre> var CUSTOM_PLACEHOLDER = "Search Plasma-Therm";
             
             $searchBox = $("#quick-search-query");
            </pre></td></tr></tbody></table><p><br></p>
            

            Petch (Inactive) added a comment - Thanks Jason. Narrowed down further to the following markup: <p><br></p><table class= "wysiwyg-macro" style= "background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGl0bGU9Q3VzdG9tIEhUTUwgYXQgdGhlIGVuZCBvZiB0aGUgYm9keXxsYW5ndWFnZT1qYXZhc2NyaXB0fGNvbGxhcHNlPXRydWV9&amp;locale=en_GB&amp;version=2); background-repeat: no-repeat;" data-macro-name= "code" data-macro-parameters= "collapse= true |language=javascript|title=Custom HTML at the end of the body" data-macro-body-type= "PLAIN_TEXT" data-mce-style= "background-image: url( 'https: //confxhtml.atlassian.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGl0bGU9Q3VzdG9tIEhUTUwgYXQgdGhlIGVuZCBvZiB0aGUgYm9keXxsYW5ndWFnZT1qYXZhc2NyaXB0fGNvbGxhcHNlPXRydWV9&amp;locale=en_GB&amp;version=2' ); background-repeat: no-repeat;" ><tbody><tr><td class= "wysiwyg-macro-body" ><pre> var CUSTOM_PLACEHOLDER = "Search Plasma-Therm" ; $searchBox = $( "#quick-search-query" ); </pre></td></tr></tbody></table><p><br></p>

            Craig -
            1) Hope the attached thread dump is what you needed. I'm out of the office, and cannot seem to remote into the server. Can try that again on Tuesday if you need more.
            2) Was able to whittle the page down to a small section that causes the error. Captured the editor markup and attached it to this ticket.

            Jason Plumhoff added a comment - Craig - 1) Hope the attached thread dump is what you needed. I'm out of the office, and cannot seem to remote into the server. Can try that again on Tuesday if you need more. 2) Was able to whittle the page down to a small section that causes the error. Captured the editor markup and attached it to this ticket.

            Thread dump taken when attempting to open page in source editor

            Jason Plumhoff added a comment - Thread dump taken when attempting to open page in source editor

            markup collected on malfunctioning page.

            Jason Plumhoff added a comment - markup collected on malfunctioning page.

            1) The stack trace would be in your server logs.
            2) This should only happen if you do not have the editor open (e.g. only viewing the page).
            3) Thanks. At least it's not browser specific.

            Petch (Inactive) added a comment - 1) The stack trace would be in your server logs. 2) This should only happen if you do not have the editor open (e.g. only viewing the page). 3) Thanks. At least it's not browser specific.

            Hi Craig,

            1) How do I get a stack trace?
            2) When I tried to run the code you gave in the development console, I got an error:
            TypeError: Cannot call method 'getBody' of null
            3) Chrome 18.0.1025.162 m, but the error occurs with IE 9.0 as well.

            Jason Plumhoff added a comment - Hi Craig, 1) How do I get a stack trace? 2) When I tried to run the code you gave in the development console, I got an error: TypeError: Cannot call method 'getBody' of null 3) Chrome 18.0.1025.162 m, but the error occurs with IE 9.0 as well.

            Petch (Inactive) added a comment - - edited

            jplumhoff can you provide more information?

            1. Is there a stack trace on the server?
            2. Are you able to attach the editor markup to this ticket (assuming it doesn't contain any sensitive information)? If not you could narrow it down to a specific block of markup (i.e. by deleting half, then half again, etc until you get a small block that doesn't open in the source editor).
            3. Which browser are you using?

            To get the editor markup, you can run the following in the browser's development tools console:

            AJS.$(AJS.Rte.getEditor().getBody()).html()

            Petch (Inactive) added a comment - - edited jplumhoff can you provide more information? Is there a stack trace on the server? Are you able to attach the editor markup to this ticket (assuming it doesn't contain any sensitive information)? If not you could narrow it down to a specific block of markup (i.e. by deleting half, then half again, etc until you get a small block that doesn't open in the source editor). Which browser are you using? To get the editor markup, you can run the following in the browser's development tools console: AJS.$(AJS.Rte.getEditor().getBody()).html()

              cpetchell Petch (Inactive)
              79e62be19901 Jason Plumhoff
              Archiver:
              mkhairuliana Monique Khairuliana (Inactive)

                Created:
                Updated:
                Resolved:
                Archived:
                13 years, 9 weeks ago