Improperly formed <BR> tags

8 posts, 0 answers
  1. Mike Fleischauer
    Mike Fleischauer avatar
    5 posts
    Member since:
    Apr 2009

    Posted 17 Jul 2009 Link to this post

    This is a two part problem, with the interaction between RadGrid and RadEditor.

    I am using (Q1) RadEditor inside a RadGrid.  I have encountered a bit of a problem.  When the user enters newlines within the editor, it renders them as <BR> instead of the proper <BR />.  I generally wouldn't care.  Unfortunatly, later when I do a call to RadGrid->ExportToPdf() I get the following exception:

    Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
    Parse error:
    The 'br' start tag on line 688 does not match the end tag of 'div'. Line 688, position 268.
    at line:
    <span id="ctl00_BodyPlaceHolder_RadGrid1_ctl00_ctl04_Label2">In lists granted to other people, you currently can't see the thumbnails without permission.<div><br><div>Add a check in file loader for ListPermission exception.</div></div></span>


    If you edit the Grid item to not contain any newlines it works correctly.  Add a new return in the editor and export will break again.

    So, I either need RadEditor to render properly formatted HTML, or I need Rad Grid to be less strict in its HTML parsing.  Personally, I actually view this as a bug in both products as RadEditor should encode newlines as <BR /> instead of <BR> and RadGrid's export to PDF should be able to handle this situation.


    Is there a workaround?
  2. Rumen
    Admin
    Rumen avatar
    14100 posts

    Posted 22 Jul 2009 Link to this post

    Hello Mike,

    You should not experience this problem, because RadEditor for ASP.NET AJAX produces XHTML compliant content and the editor inserts <br/> tags on enter key press. Are you able to insert <br> tags when typing in the editor in the following live example: Column Types?

    For your convenience I have attached a video demonstrating my test.


    Sincerely yours,
    Rumen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Josep
    Josep avatar
    3 posts
    Member since:
    Jun 2008

    Posted 04 Aug 2009 Link to this post

    Hello,

    Currently we have a similar problem with chrome browser, when press enter, the editor adds  <div><br/></div> instead of <br/>.

    Do you know how we can solve it?

    Thanks for all.
  4. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 07 Aug 2009 Link to this post

    Hello Josep,

    This is the behavior of the Safari/Chrome browser's rich-text engine. It is not identical to the IE/FF/Opera implementations and we have already logged this for implementation for the coming Q3 2009. At this point there is no way to change this behavior easily.

    Best regards,
    Tervel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Josep
    Josep avatar
    3 posts
    Member since:
    Jun 2008

    Posted 07 Aug 2009 Link to this post

    Hello,

    Ok, We wait for the next version.

    Thanks for all.
    Avanzis.
  6. Timothy Stanton
    Timothy Stanton avatar
    11 posts
    Member since:
    Sep 2004

    Posted 23 Nov 2009 Link to this post

    I am seeing the exact same problem in IE7. I am not sure this is only a safari issue
  7. Mike Fleischauer
    Mike Fleischauer avatar
    5 posts
    Member since:
    Apr 2009

    Posted 23 Nov 2009 Link to this post

    @Timothy Stanton, I agree, we experienced the problem across all browsers we test on ( the big 5 ), it is not specific to the browser.  As I said in my original post, it was the generated html from the rad editor and the parsing of that html by the RadGrid.  If we set a breakpoint and manually reformed <br> to <br />, everything worked fine.

    In the end, we just gave up on this feature ( export to pdf ) and use a PDF library we already had access to.  Would be nice to see this resolved anyways.
  8. Abhijit
    Abhijit avatar
    3 posts
    Member since:
    May 2015

    Posted 24 Oct 2017 Link to this post

    SOLVED: I came across a similar problem. I had BR tags inside of SPAN tags. I changed the SPAN tags with DIV tags but it had no effect.

    NOTE that I am using Kendo PDF Export and not RAD Grid but this should work for you too.

    Then I compared this with a similar issue with another part of the page. The only difference was P tags. So I replaced my HTML:

    <div>content<br/>content</div>

    with

    <div><p>content<br/>content</p></div>

    and I don't see the error anymore. 

    Thanks,
    Abhijit

Back to Top