# Plugin admin button broken styling

**URL:** <https://meta.discourse.org/t/plugin-admin-button-broken-styling/54719>\
**Category:** Development\
**Created:** [December 23, 2016, 6:19pm UTC](https://meta.discourse.org/t/plugin-admin-button-broken-styling/54719 "2016-12-23T18:19:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kgish](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kgish/32/121131_2.png) [@kgish](https://meta.discourse.org/u/kgish)\
**Post date:** [December 24, 2016, 10:44am UTC](https://meta.discourse.org/t/plugin-admin-button-broken-styling/54719/3 "2016-12-24T10:44:00Z")

</div>

For those interested, this is my workaround until someone from the Discourse team fixes it.

Basically I need to `unwrap` the stuff inside the `span` like this:

```html
<ul><span><li><a>...</a></li></span></ul>`

```

to this:

```html
<ul><li>...</li></ul>

```

```plaintext
{{#link-to 'admin.pvda' id='admin-menu-pvda'}}
  {{i18n 'pvda.admin.menu_title'}}
{{/link-to}}

```

```javascript
 api.onPageChange((url, title) => {

  // --- ADMIN PAGE --- //
  if (/\/admin\//.test(url)) {
    // Admin pages start with "/admin/*"
    let sel = '#admin-menu-pvda',
         pvda_menu_item = $(sel);
    if (pvda_menu_item.length) {
      let li = pvda_menu_item.parent();
      if (li.is("li")) {
        let span = li.parent();
        if (span.is("span")) {
          li.unwrap();
        }
      }
    }
  }
  ...
}

```

---

_[View the full topic](https://meta.discourse.org/t/plugin-admin-button-broken-styling/54719)._
