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

Adding   via Insert Symbol is not working

5 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 11 Mar 2020, 10:52 AM

It seems that adding an   via "Insert Symbol" is not working. 

We can reproduce this issue on the demo trial: I have downloaded the demo trial as a standalone-application, added the non-breaking space into toolsFile.xm and checked the behavior.

Please see this screencast for more details: https://www.screencast.com/t/J9aB5KdLr

We tried to create a custom ContentFilter that will replace the all zero width space characters to non-breaking space in the content. But that seems not to work as we don't have those zwsp charachters in the content withing the ContentFilter. Tried soluiton based on this post:https://www.telerik.com/forums/zwsp-inserted-into-html-in-chrome

Anyone had this issue before and found a solution?

 

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 12 Mar 2020, 04:10 PM

Hi,

Can you define the white space like this and test again:

  <symbols>
    <symbol value="\u0020;" />
  </symbols>

Regards,
Rumen
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Tony
Top achievements
Rank 1
answered on 13 Mar 2020, 10:03 AM

Hi,

This works indeed, a space is added. But the point is that we explicitily need the "non-breaking-space" charachter.

It is used to avoid a split between e.g. a value and a unit: 20 kg. So in HTML we would like to have "20&nbsp;kg" instead of a normal space "20 kg". As this last one can cause a split to a new line between "20" and "kg". So the "\u0020;" charachter doesn't help in this case. 

Regards

Tony

 

 

0
Accepted
Rumen
Telerik team
answered on 17 Mar 2020, 01:17 PM

Hi Tony,

Thank you for the extra details!

The solution to keep the &nbsp; when inserting the <symbol value="&#160;" /> symbol is to override the following function:

<script>
    Telerik.Web.UI.Editor.NodesTracker.prototype.pasteDomHandler = function (editor, args) {
    }
</script>
<telerik:RadEditor id="RadEditor1" runat="server" ... />

 

Regards,
Rumen
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Tony
Top achievements
Rank 1
answered on 30 Mar 2020, 03:27 PM

Hi Rumen,

Thanks for pointing us in the good direction. We were able to fix the issue by commenting the call to convertSingleNbspToTrackedZws().

Telerik.Web.UI.Editor.NodesTracker.prototype.pasteDomHandler = function (editor, args) {
    var m = this;
    //m.convertSingleNbspToTrackedZwsp(args.get_element());
    var i = args.get_cursor(), l = i.previousSibling, k = i.nextSibling;
    if (m.isZeroWidthNode(l)) {
        a(l).remove();
    } if (m.isZeroWidthNode(k)) {
        a(k).remove();
    }
}

 

Regards

Tony

0
Rumen
Telerik team
answered on 30 Mar 2020, 04:00 PM

You are welcome, Tony!

Keep up the good work!

 

Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Tony
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Tony
Top achievements
Rank 1
Share this question
or