This is a migrated thread and some comments may be shown as answers.

Adding line breaks before H1 tag?

7 Answers 132 Views
Editor
This is a migrated thread and some comments may be shown as answers.
fabian
Top achievements
Rank 1
fabian asked on 14 Apr 2011, 09:27 PM
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

7 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 19 Apr 2011, 10:02 AM
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.

0
fabian
Top achievements
Rank 1
answered on 19 Apr 2011, 06:19 PM
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
0
Rumen
Telerik team
answered on 20 Apr 2011, 07:13 AM
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.

0
fabian
Top achievements
Rank 1
answered on 20 Apr 2011, 04:12 PM
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
0
Rumen
Telerik team
answered on 22 Apr 2011, 02:18 PM
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.

0
Tri Nguyen
Top achievements
Rank 1
answered on 01 Feb 2018, 05:48 PM

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

 

0
Rumen
Telerik team
answered on 02 Feb 2018, 09:01 AM
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.
Tags
Editor
Asked by
fabian
Top achievements
Rank 1
Answers by
Rumen
Telerik team
fabian
Top achievements
Rank 1
Tri Nguyen
Top achievements
Rank 1
Share this question
or