I'm using episerver 7.1 with mvc razor. When using and contentareas and blocks I get Extra div Tag around it.
How do I make it go away?
Do I have to implement a own renderer as done in alloy templates or what?
The block container nodes are necessary for editing the blocks in on page edit.
ContentAreas renders a two level structure. A container node for the content area and one block container node for each block. Like this:
<div><!-- rendered content of block 1 --></div>
<div><!-- rendered content of block 2 --></div>
And when the ContentArea is rendered in edit mode those block container nodes include the block information (and some more attributes)
<div data-epi-block-id="31"><!-- rendered content of block 1 --></div>
<div data-epi-block-id="32"><!-- rendered content of block 2 --></div>
If you really need to you can of course implement your own renderer, but then you would have to have different rendering between preview and edit (if you want to enable edit of blocks on the page). I wouldn't recommend it.
Well, I understand the need in edit mode.
But when on the site in "viewmode" you do no need or want them (in my opinion). Should be configurable at least.
The decision has been to make the two modes render the same. One thing we wanted to avoid, is that the partner needs to style two cases. Whether it should be a container node or not is debatable. I don't think it's wrong not want them in view mode. As it is now, it's consistent. When the blocks are rendered, there's no way for us to know how the block will be rendered. It could be only a text node, without any elements. From that point of view, I think it's fine to render container nodes around the blocks. But this could of course change for future releases. We have discussed these options. You're not the only one to ask about it.