This thread discusses a bug in Discourse’s plugin-outlet system, where multiple plugins rendered at the same outlet incorrectly wrap content in a div, breaking HTML structure—especially problematic in contexts like <ul> where direct <li> children are required. dmitry_fedyuk identifies the issue in the code and proposes replacing Ember.ContainerView with Ember.ContainerView.extend({tagName: ''}) to eliminate the wrapper div, which he confirms works for his admin-menu plugins dmitry_fedyuk. eviltrout initially considers it feasible but later notes that applying tagName to the container view causes unintended child divs eviltrout. cpradio notes HTML5 allows <li> to contain block elements, reducing the severity, but the structural wrapping remains problematic. nikdavis reports a similar issue with the user-activity-bottom outlet affecting CSS selectors. sam suggests widgets as a workaround, but eviltrout clarifies widgets also require a container tag. Later, sam notes the issue was resolved in newer versions, and eviltrout confirms the fix involves tagName: '', though ensuring backward compatibility with existing plugins is the challenge. sam closes the thread, pointing to a working pattern using tagName="" and connectorTagName="" in connectors, inviting community PRs to fix missing instances.
Must be Ember.ContainerView.extend({tagName: ''}) instead of Ember.ContainerView.
The current wrong code breaks HTML markup in cases where HTML syntax does not allow wrapper DIV tag.
An example is admin-menu plugin outlet:
If there are multiple admin-menu connectors then Discourse wrongly renders them as:
<ul>
<!-- standard menu items: -->
<li></li>
<li></li>
<!-- admin-menu connectors: -->
<div>
<li></li>
<li></li>
</div>
</ul>
Oops I see what you mean Sam. If I apply the tagname to the ContainerView it’s not what you want, because then you are expecting the children to have li too.
I’m gonna ask people about this. Maybe I can append to the Morph.
Replacing Ember.ContainerView to Ember.ContainerView.extend({tagName: ''}) as I described in the first message definitely works, I have tested it for my multiple plugins at admin-menu outlet.
It didn’t work when I tried it. If you pass the tagName to the ContainerView the container gets the li tag, but then the children get div tags. So adding two <li> doesn’t work.
Except, I think that is valid HTML now (as of HTML 5). I think li can contain block elements (such as div), so that is less of a problem than the li being wrapped in a div.
Sure a widget could be mounted with a metamorph or something similar - the problem is you always need a {{mount-widget}} to start hosting them and that needs a tag.