In template edit mode - going to source code makes some blocks double

Q: If I open a template for editing, and then choose to view the html code, it seems something is off. And when I go back to Edit (wysiwyg) some blocks are now double. Where did the extra text suddenly come from?


A: After receiving your template, we can confirm this behavior.

The issue stems from the html code having syntactical errors that can't be recovered.

There are several <P> blocks inside a <SPAN> block (that are also missing the closing </P> block.)

When switching view to the html code the Document-Object-Model is extracted and parsed into a plain text editor. Normally the editor is able to deduce if any elements are missing and amend the situation. But that is not always the case. Especially if compounded by other overlapping issues.

In the provided code there was a <P> (with missing </P>) inside a <SPAN> block.

<SPAN> is allowed inside <P> like this <P><SPAN>Text</SPAN></P>

But <SPAN><P>Text</P></SPAN> is not W3C compliant.

To remedy this, you should do a review of you source code and try and glean what tags are missing or superfluous, and if there is any P-tags inside SPAN-tags.

Enclosed is a revised html file, that do not exhibit the issue.

Yellow highlight marks two tag's that has no closing tag's. Removing them solves the problem.

Source Code with missing tags

Rate this item
(0 votes)
back to top