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

hgroup tag issue

1 Answer 35 Views
Editor
This is a migrated thread and some comments may be shown as answers.
HSLaw
Top achievements
Rank 1
HSLaw asked on 06 Jun 2014, 07:04 AM
Hi,

I try to paste following in the editor HTML view:

<hgroup>
    <h1>Title goes here</h1>
    <h2>Subtitle of article</h2>
</hgroup>


When I change to Design and then back to HTML view, the code changed.

<hgroup>
</hgroup>
<h1>Title goes here</h1>
<h2>Subtitle of article</h2>



How can we solve this?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 09 Jun 2014, 10:59 AM
Hello,

The described behavior is due to improvements in the RadEditor to generate well formed HTML markup.

The bug introduced is due to lack of explicit predilection of the block elements, which causes the editor to not recognize some tags as block elements. 

The feedback portal item related to the task can be followed for updates and possible solutions. 

I suggest using the following workaround:
<telerik:RadEditor runat="server" ID="RadEditor1">
    <Content>
        <hgroup>  
          <h1>Title goes here</h1
         <h2>Subtitle of article</h2>
        </hgroup>
    </Content>
</telerik:RadEditor>
 
<script type="text/javascript">
    Telerik.Web.UI.Editor.Utils.isBlockElement = function (element) {
        return this.checkForElement(element, /^(?:body|p|div|h[1-6]|form|fieldset|table|thead|tbody|tr|th|td|ul|ol|li|dl|blockquote|address|hr|nav|hgroup)$/i);
    };
</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.

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