I am experiencing an issue in the Telerik Rad Editor where, after copying and pasting a long sentence in a single line, if I apply bold formatting to a word and place the cursor at the beginning of the bolded word, pressing Enter results in an empty line being inserted between the text. This behavior is reproducible on the Telerik webforms editor demo site as well.
I would appreciate any guidance on how to resolve this issue. Thanks in advance.
Hi,
After additional research, I'd like to clarify that this is not a real bug but rather a browser behavior. The browser renders the ​
character (used as a special placeholder for cursor positioning in the internal logic of the editor's InsertParagraphCommand
) on a new line when the text exceeds the width of the content area.
Please note the following:
​
character does not get saved into the database.Optional Workaround
If you prefer to avoid this behavior altogether, you can override the internal setCursor method of the InsertParagraphCommand to prevent the ​ from being rendered. Below is an example of how you can achieve this:
<script>
Telerik.Web.UI.Editor.InsertParagraphCommand.prototype.setCursor = function (container, cursor) {
var editor = this.get_editor();
var nextSibling = cursor.nextSibling;
// Remove the cursor placeholder node
cursor.parentNode.removeChild(cursor);
var range = this.domRange;
// Default: place the cursor at the start of the container or before the next sibling
range.setStart(container, 0);
range.collapse(true);
range.select();
}
</script>
<telerik:RadEditor runat="server" ID="RadEditor1" Height="600px">
<Content>aaaaa<strong>test</strong>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>aa<strong>aaaaaa</strong>aaaa</Content>
<Modules>
<telerik:EditorModule Name="RadEditorStatistics" Visible="true" />
<telerik:EditorModule Name="RadEditorDomInspector" Visible="true" />
<telerik:EditorModule Name="RadEditorNodeInspector" Visible="false" />
<telerik:EditorModule Name="RadEditorHtmlInspector" Visible="true" />
</Modules>
</telerik:RadEditor>
Regards,
Rumen
Progress Telerik
Thank you for your response, Rumen. This issue was raised by one of our customers, and resolving it is quite important for them. Would it be possible to provide an estimated timeline for when we might expect a fix or any further updates on this?
Thank you again for your support.
Thank you for bringing this issue to our attention! I have converted your forum post into a bug report for our team to investigate further.
Regards,
Rumen
Progress Telerik