Adding line breaks before H1 tag?

8 posts, 0 answers
  1. fabian
    fabian avatar
    11 posts
    Member since:
    Dec 2010

    Posted 14 Apr 2011 Link to this post

    Hello,
    I have notice a problem that is not possible to add a line break <br/> before an <h1> tag when using the editor. If Press the enter key it just adds another <h1></h1>tag. How can I add line breaks  for spacing above the <h1> tag?

    thank you
  2. Rumen
    Admin
    Rumen avatar
    14220 posts

    Posted 19 Apr 2011 Link to this post

    Hello Fabian,

    The reported behavior is by design and it was requested by multiple users.
    Currently, you can add a line break before a heading tag by pressing Shift+Enter.

    Best regards,
    Rumen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. fabian
    fabian avatar
    11 posts
    Member since:
    Dec 2010

    Posted 19 Apr 2011 Link to this post

    Hello,
    I understand, but if i hit shift+enter it doesn't work. If I insert the line break that way then look at the html code there is no line break introduced.
    If you were correct it would look something  like: <br/><h1>title</title> but there is no br.
    Do you see what I mean?
    thank you
  4. Rumen
    Admin
    Rumen avatar
    14220 posts

    Posted 20 Apr 2011 Link to this post

    Hi Fabian,

    The observed behavior is due to the content optimization RemoveExtraBrakes filter of RadEditor which strips all extra brakse inside some tags like p, h1, li etc.
    To disable this behavior, please, put the following javascript code after the RadEditor declaration:

    <telerik:radeditor runat="server" ID="RadEditor1"></telerik:radeditor>
    <script type="text/javascript">
    Telerik.Web.UI.Editor.RemoveExtraBrakes.prototype.getHtmlContent = function (content) {
        return content;
    }
    Telerik.Web.UI.Editor.StripJunkFilter.prototype.getHtmlContent = function (content) {
        return content;
    }
    </script>

    Kind regards,
    Rumen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. fabian
    fabian avatar
    11 posts
    Member since:
    Dec 2010

    Posted 20 Apr 2011 Link to this post

    Hello,
    That seems to have erratic results in IE9. When switching between design/html it adds extra br tags

    From:
    <h1>
    </br>
    Who We Are</h1>

    to
    <h1><br>
    </br>
    <br>
    </br>
    <br>
    </br>
    <br>
    </br>
    Who We Are</h1>

    after a few times switching back and forth
    do you have a working demo?

    It seems ok on Firefox
  6. Rumen
    Admin
    Rumen avatar
    14220 posts

    Posted 22 Apr 2011 Link to this post

    Hi Fabian,

    This bug was fixed in Q1 2011 SP1. Are you able to reproduce it in the Default example of RadEditor? You can see my test in the following video: http://screencast.com/t/J5P4IAu4YCb.

    Best regards,
    Rumen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  7. Tri Nguyen
    Tri Nguyen avatar
    43 posts
    Member since:
    Feb 2004

    Posted 01 Feb 2018 in reply to Rumen Link to this post

    Hello,

    I don't know if this issue has been fixed. But it is still happening with the version 2017.3.913.40. As I typed up this message, when I hit Enter after "Hello," an additional line was added. In my code, I set the NewLineBr="false". It doesn't seem to help at all. I even applied the following script segment:

    <script type="text/javascript">
    Telerik.Web.UI.Editor.RemoveExtraBrakes.prototype.getHtmlContent = function (content) {
    return content;
    }
    Telerik.Web.UI.Editor.StripJunkFilter.prototype.getHtmlContent = function (content) {
    return content;
    }
    </script>

    But it still doesn't work. Please advise.

    Thanks.

    Tri

     

  8. Rumen
    Admin
    Rumen avatar
    14220 posts

    Posted 02 Feb 2018 Link to this post

    Hi Tri, 

    Are you able to reproduce the problem in the Overview demo of RadEditor?

    You can change the value of the NewLineMode property directly via the provided configuration radio button list:

    NEW LINES AS
    Breaks
    Paragraphs
    Divs

    If you are able to reproduce the problem, please provide steps (screenshots or video) and sample content to reproduce it on our end.

    Best regards,
    Rumen
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top