Span in DOM Inspector

8 posts, 0 answers
  1. Dan Ehrmann
    Dan Ehrmann avatar
    152 posts
    Member since:
    Jul 2004

    Posted 14 Dec 2014 Link to this post

    When I enter a span tag in the editor content, the DOM inspector shows it as a font tag.

    You can see this on the demos. Just clear the content in the editor, go the html view, and type in very simple html like this: <span>hello</span>

    Switch to design view and check it in the inspector - it is now called 'font'. The actual html is not changed (it is still a span), but the inspector gets it wrong.

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 17 Dec 2014 Link to this post

    Hi Dan,

    This is due to the ConvertFontToSpan filter, disabling it will configure the RadEditor not to transform it when in Design mode.

    You can examine also this demo.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dan Ehrmann
    Dan Ehrmann avatar
    152 posts
    Member since:
    Jul 2004

    Posted 17 Dec 2014 in reply to Ianko Link to this post

    I see in the demo that the filter causes this to happen. It is still a bug, and should be fixed. I want to use the ConvertFontToSpan filter, and I also want a span tag to appear as a span tag in the inspector.
  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 17 Dec 2014 Link to this post

    Hello Dan,

    This is the designed behavior of this filter, it converts font to span in HTML and in Design vice versa. 

    To alter this behavior you can just reset the getDesignContent method of the filter:
    <telerik:RadEditor runat="server" ID="RadEditor1">
    </telerik:RadEditor>
     
    <script>
        Telerik.Web.UI.Editor.ConvertFontToSpanFilter.prototype.getDesignContent = function (contentAreaElement) {
            return contentAreaElement;
        };
    </script>


    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Dan Ehrmann
    Dan Ehrmann avatar
    152 posts
    Member since:
    Jul 2004

    Posted 17 Dec 2014 in reply to Ianko Link to this post

    I guess I don't understand...

    I do not have any font tags. I entered a span tag. There is nothing to convert, and yet the filter made a change.

    The inspector is displaying my span tag as if it were a font tag. Which it is not.

    If the filter is supposed to replace font tags, then there should never be a font tag displayed in the inspector - especially if there were never any font tags to begin with.
  7. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 22 Dec 2014 Link to this post

    Hello Dan,

    By design, the ConvertFontToSpan filter converts FONT tags to SPAN when switching to HTML mode, and when in Design SPAN to FONT ones. Therefore, once a SPAN tag is added into the HTML, switching to Design replaces it with FONT one. 

    The described behavior can be altered with the function override provided previously. You can also examine this screencast.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Dan Ehrmann
    Dan Ehrmann avatar
    152 posts
    Member since:
    Jul 2004

    Posted 22 Dec 2014 in reply to Ianko Link to this post

    I see what you mean, and I appreciate the video.

    So, this thread changes from a bug report to a feature request.

    I think that changing font tags to span tags is a very good idea.

    I think that changing span tags to font tags is a very bad idea.

    I suggest you modify the filter so that span tags are preserved in design mode.
  9. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 24 Dec 2014 Link to this post

    Hi Dan,

    Thank you for the feedback.

    A possible change of this filter might be quite crucial to many other clients. I can understand that to change span tags to font seems awkward and somehow incorrect. Although, you should note that the RadEditor is commonly used for emails' body creation, and thus, used in many legacy systems that entirely depends on how the HTML is rendered.

    When it comes to such matters, we cannot just redesign a filter that is commonly used and disregard the fact that many other developers of such applications will struggle on investigating what possible went wrong and why something previously working, do not work due to a minor change of a simple built-in filter.

    As for the case,  as you can see the mentioned filter can be easily modified to perform as per to your requirements. And a possible, even more reliable option is to disable it entirely and build a custom filter that suits best the encountered case scenario.

    On a side note, when it comes to logging a feature request, you can always directly log one in our Public Feedback Portal and place the desired description, so that other developers in the Telerik community could vote for it.

    Let me know if I can help any further on the matter.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017