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

Endless font size tags

5 Answers 71 Views
Editor
This is a migrated thread and some comments may be shown as answers.
-DJ-
Top achievements
Rank 1
-DJ- asked on 29 Jul 2008, 06:45 PM
Hi,

I'm just taking my first look at the current version of the editor. If a user is playing with the font-size dropdown, trying to find a suitable size for his text, everytime he selects a new size a span tag is added.

So instead of replacing the last span tag, you get a new one.

You end up with something like this:
<span style="font-size: 8px">  
<span style="font-size: 10px">  
<span style="font-size: 11px">  
<span style="font-size: 18px">  
<span style="font-size: 16px">  
 
Hello World!  
 
</span> 
</span> 
</span> 
</span> 
</span> 
 

I've been playing around with this, to be sure it wasn't some freak accident, and it happens more often than not, but still not always.

Not the ideal result.

Regards,
-DJ-

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Jul 2008, 06:35 AM
Hi -DJ-,

I tried to reproduce the reported problem in IE and Firefox but unfortunately to no avail. You can see my test in the attached video. You will see that the selection should be placed exactly over the text without spaces outside it.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
-DJ-
Top achievements
Rank 1
answered on 30 Jul 2008, 10:12 AM
Hey Rumen,

You are right, it only happens if you select spaces around text as well, and it seems more likely to happen if you are deselecting something and reselecting it.

However, the Real-Time HTML View isn't totally accurate. It shows font tags while the source in the editor is actually span tags.

Regards,
-DJ-
0
Rumen
Telerik team
answered on 30 Jul 2008, 01:08 PM
Hi -DJ-,

The observed behavior is due to one of the editor content filters (ConvertFontToSpan). The filter converts all <font> elements to <span> when you retrieve the HTML content and back into <font> elements when you are in design mode. This is needed because all browser commands work with the FONT tag and to prevent side effects we convert all SPAN tags to Font tags in Design mode.

Kind regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
-DJ-
Top achievements
Rank 1
answered on 31 Jul 2008, 01:10 AM
Hey Rumen,

That's a lovable filter indeed I guess.

 I don't mean to be nitpicking, but in the end, users tend to be somewhat computer illiterate. Perhaps they don't always see the obvious reason to deselect that space after the last word in a sentence.

So you can indeed end up with multiple span tags around a single sentence or a single word, right?
0
Rumen
Telerik team
answered on 31 Jul 2008, 06:56 AM
Hi -DJ-,

Yes, I agree with you that in scenarios when the selection contains space after the last word it is possible to produce nested spans in the editor using the RealFontSize dropdown. I logged this behavior for research and if possible our developers will fix the issue.

Currently, my suggestion is to test the  <tool Name="FontSize" /> tool of the editor and see whether you are able to replicate the problem. If it works as expected you can replace the RealFontSize tool with it.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
-DJ-
Top achievements
Rank 1
Answers by
Rumen
Telerik team
-DJ-
Top achievements
Rank 1
Share this question
or