Endless font size tags

6 posts, 0 answers
  1. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 29 Jul 2008 Link to this post

    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-
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 30 Jul 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 30 Jul 2008 Link to this post

    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-
  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 30 Jul 2008 Link to this post

    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.
  6. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 30 Jul 2008 Link to this post

    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?
  7. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 31 Jul 2008 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017