Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can I fix CKEditor 4.5.8

Discussion in 'User Experience' started by ottdev, May 6, 2017.

Tags:
  1. ottdev

    ottdev Well-Known Member

    Joined:
    Oct 1, 2013
    Messages:
    76
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    On cPanel 64build19, the File Manager HTML Editor CKEditor is version 4.5.8 and is not behaving the same way as an older server running 4.2.1

    They both insert extraneous <p></p> tags - which seems to be okay because the 4 browsers I tested ignore these. However, there's an issue in the latter CKEditor itself rendering these as spaces.

    Open a file. you don't even have to edit, just hit the [Source] button to check what it's doing - see some <p></p> that weren't in your original code ? Click [Source] on and off and you can see your text moving down the page in the WYSIWYG view.

    Is anyone familiar enough with CKEditor to advise what files to edit on our server? I do not know if this was a bug fixed in a later release (CKEditor release notes do not provide detail about bugs fixed) or this is something related to cPanel's configuration of it which changed from earlier.

    Also, is there something that can be done to have it not add <p> and </p> around SSI ?

    HTML:
    <!--#include virtual="/ssi/main_end.shtml" -->
    <!--#include virtual="/ssi/page_footer.shtml" -->
    </body>
    </html>

    HTML:
    <p><!--#include virtual="/ssi/main_end.shtml" --><!--#include virtual="/ssi/page_footer.shtml" --></p>
    <p></p>
    
    <p></p>
    
    <p></p>
    </body>
    </html>
    Because once parsed and served to browser, I end up with unwanted nonsense like divs encapsulated in paragraphs and a broken site design layout.

    Many thanks!
     

    Attached Files:

  2. ottdev

    ottdev Well-Known Member

    Joined:
    Oct 1, 2013
    Messages:
    76
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    They both insert extraneous <p></p> tags - which seems to be okay because the 4 browsers I tested ignore these.
    My statement was WRONG.
    I must have been looking at the wrong file not the one I was mangling in CKEditor.
    All 4 desktop browsers (FF,Chrome,IE,Edge) and 3 android browsers I tried all do indeed render all those extraneous paragraph tag sets as spaces. i.e. Even just opening a file in ckeditor and editing some text and saving it adds some <p></p>. Open again and they multiply. Hit [Source] and they mutiply even more. Like rabbits. And the text ends up way down the page with a bunch of unwanted white space.
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,765
    Likes Received:
    313
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm unable to duplicate either of these issues on the same version of cPanel. Please feel free to open a ticket to Technical Support about this. If there's an issue, they'd like to know about it I'm sure. :)
     
  4. ottdev

    ottdev Well-Known Member

    Joined:
    Oct 1, 2013
    Messages:
    76
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I found the trick.
    WHM is 64 build 20 now; ckeditor is 4.5.8 c1fc9a9

    Here's some code to test with that will cause the issue:
    Code:
    <!DOCTYPE html>
    <html lang='en'>
    <head>
    <!--#include virtual="/ssi/meta_tags_all_pages.shtml" -->
     <meta name="description" content="">
     <meta name="keywords" content="">
     <title>__PAGE_TITLE__</title>
    </head>
    <body class="grid-1">
    <!--#include virtual="/ssi/begin_page_and_upper_nav.shtml" -->
    <picture><img alt="__SCREEN_READER_ALT_TEXT__"
    title="__ADVISORY_HOVER-OVER_IMAGE_TEXT__"
    src="/images/placeholder.gif">
    </picture>
    <!--#include virtual="/ssi/code_for_div_with_copyright_for_all_images.shtml" -->
    <h2>Use &lt;h2&gt; for headings &lt;/h2&gt; </h2>
    <p>__YOUR_TEXT_HERE__  (replace this line with your text)</p>
    <p>Start and end paragraphs with &lt;p&gt; and  &lt;/p&gt;
    <br>you may start new lines (without paragraph spacing) using &lt;br&gt;</p>
    <!--#include virtual="/ssi/lower_nav_and end_page.shtml" -->
    </body>
    </html>
    You see in my image here just opening the file in HTML Editor inserts space (as compared to its own preview)
    See pic - at left is in the workspace, at right is its [Preview].
    Now if you hit [Source] button you see the extra <p></p> in the code. Each time you click on/off [Source] - even more P's and text moves down the page in ckeditor workspace.

    What avoids this issue - ensure that the file _itself_ has a <div> or <header> immediately following your <body> tag and </div> or </footer> immediately before your </body> tag. In my case, the <header>...</header> and <footer>...</footer> chunks are served from the SSI files ;) but ckeditor of course, doesn't see those. So just a plain <div> is working fine, still allowing me to keep most of the code hidden safely away from the end-user.

    Code:
    <html lang='en'>
    <head>
    ...
    </head>
    <body class="grid-1"><div>
    ... 
    </div></body>
    </html>
     

    Attached Files:

Share This Page