# Custom BBCode Help/Advice

**URL:** https://meta.discourse.org/t/custom-bbcode-help-advice/84005
**Category:** Development
**Created:** [March 28, 2018, 12:03am UTC](https://meta.discourse.org/t/custom-bbcode-help-advice/84005 "2018-03-28T00:03:12Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Ellibereth](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ellibereth/32/202896_2.png) [@Ellibereth](https://meta.discourse.org/u/Ellibereth)
#### Post date: [April 4, 2018, 5:04am UTC](https://meta.discourse.org/t/custom-bbcode-help-advice/84005/3 "2018-04-04T05:04:24Z")

</div>

```plaintext
    tag: 'vote',
    replace: (state, tagInfo, content) => {
      let token;
      token = state.push('span_open', 'span', 1);
      token.attrs = [['class', 'vote']];
      token = state.push('text', '', 0);
      token.content = 'VOTE:' + content;
      token = state.push('span_close', 'span', -1);
      return true;
    },
  });

```

Basically did this and defined a new vote class that was the same as highlight’s but also with bold.  
I tried a lot of silly thing without tokens and without defining the new class at first but it became clearer after looking at some of the more complicated wrap examples, though there was still some trial and error for notation.

---

_[View the full topic](https://meta.discourse.org/t/custom-bbcode-help-advice/84005)._
