I have this markup
<html> ... some HTML ...
And I need to wrap it with such an element:
<html> <div class="user-content"> ... some HTML ... </div>
The problem is ... some HTML ... can be many different things from raw text to complex markup.
<div>
If I use a <div> , then it adds a block level break. Value if i
Paul is cool
now I have
<div class="user-content"> Paul is cool </div>
which forces a line break.
<span>
If I use <span> , then weird things start when I have a <span> containing a <div> . For example, span width is displayed as 0px, which makes javascript not too happy with node.
Is there a better tag I can use?
Some context
It's a long story. I need a node to exist in HTML, since I am running untrusted javascript, and I do not want javascript to be able to walk inside that node. To do this, we isolated all the DOM functions, and each time we call the DOM, we will check whether we work with the "user-content" node and do not allow access if we go there or to any of its children.
html
Paul tarjan
source share