Custom BBCode Help/Advice

    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.

2 Likes