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

Span in DOM Inspector

7 Answers 125 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dan Ehrmann
Top achievements
Rank 1
Dan Ehrmann asked on 14 Dec 2014, 07:21 PM
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.

7 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 17 Dec 2014, 12:51 PM
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.

 
0
Dan Ehrmann
Top achievements
Rank 1
answered on 17 Dec 2014, 03:34 PM
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.
0
Ianko
Telerik team
answered on 17 Dec 2014, 05:10 PM
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.

 
0
Dan Ehrmann
Top achievements
Rank 1
answered on 17 Dec 2014, 05:24 PM
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.
0
Ianko
Telerik team
answered on 22 Dec 2014, 09:35 AM
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.

 
0
Dan Ehrmann
Top achievements
Rank 1
answered on 22 Dec 2014, 02:30 PM
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.
0
Ianko
Telerik team
answered on 24 Dec 2014, 12:16 PM
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.

 
Tags
Editor
Asked by
Dan Ehrmann
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Dan Ehrmann
Top achievements
Rank 1
Share this question
or