Closing Tag Error in Sitecore Experience Editor

Closing Tag Error in Sitecore Experience Editor

In one of our Sitecore project we were getting following error-

Uncaught Failed to parse page editor element demarked by script tags

Malformed page editor tags- closing tag not found. Opening tag:

[code#main.scpm, context:code#main.scpm]

Uncaught Failed to parse page editor element demarked by script tags

This error occurs if there are missing closing HTML tag in any rich text field of item before rendering it. Now it was more surprising when we cross check and find that everything was properly and valid in RTE, but error was there. We were sniping the text to show limited number of characters on one of our control and this control was sniping the text from RTE field without clearing HTML from it. Now when our code was doing this one closing b tag removed and this error occurred. To resolve this kind of error when can chose one of the following option-

  • Chose Multi line field instance for Rich text field if possible
  • Remove HTML before sniping the text
  • Use jQuery for limiting the character limit
  • Optimize rich text HTML so possibly there no any closing tag.

I always prefer to using a multi line text field or using jQuery for limiting character count.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s