Vulnerability in EPiServer.Forms
When you add dynamic content in an editor it will add a bunch of divs as a placeholder for your dynamic content in the editor. Since the div tag is not allowed inside a p tag this will cause the insertion of dynamic content to close the p tag before it and start a new one after it which in turns results in line breaks.Example:Lets say you have the following code:
<p>You are visiting [Insert web site name using dynamic content here] right now.</p>
When you insert the dynamic content the resulting html will be this:
<p>You are visiting</p>
<div data-hash="+rt+MXKboxafKb0V2uY/v+RkPhtJ6S8/vJm0W0szokk=" data-state="a692c541-3dc2-4461-b2ca-23ce16c960d6|WebSiteName" data-dynamicclass="PagePropertyPlugin" data-classid="b30218a7-77fc-43dd-a844-81935aa9b35e" class="epi_dc mceNonEditable">
<div class="epi_dc_title">Page property</div>
<div class="epi_dc_t"><a href="#" class="epi_dc_editBtn">.</a><a href="#" class="epi_dc_previewBtn">.</a></div>
<li style="display: inline-block; padding-right: 10px;">From page: <strong>Site configuration </strong></li>
<li style="display: inline-block;">Property: <strong>Web site name</strong></li>
<p> right now.</p>
As you can see the fact that the dynamic content placeholder is rendered with divs causes tinyMCE to close the p tag just before it and open up another one right after it. (I have tried allowing divs inside of p tags by altering the config of tinyMCE but it does not seem to work.)My question is simply, is there any way you could alter the way the dynamic content placeholder is rendered so that it will render using spans instead for instance?
Seems that you might want to read this recent thread: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=79984
Thanks for the quick reply!
Yes, setting backing type to PropertyString for properties used by the built in dynamic content plugin or overriding RenderAsBlockElement when implementing your own plugin solved the problem. Thanks!