JiLiZART / BBob

⚡️Blazing fast js bbcode parser, that transforms and parses bbcode to AST and transform it to HTML, React, Vue with plugin support in pure javascript, no dependencies
https://codepen.io/JiLiZART/full/vzMvpd
MIT License
167 stars 19 forks source link

html5 preset not complete #172

Open cgorrieri opened 1 year ago

cgorrieri commented 1 year ago

Looking at the official definition of tags https://www.bbcode.org/reference.php the HTML5 preset is incomplete. Is there a plan to add the missing tags?

JiLiZART commented 1 year ago

Thanks for your issue. Yes, I can add full support for bbcode tags in future. Also when I developed html5 preset I look at https://en.wikipedia.org/wiki/BBCode

For workaround you can try to extend existing html5 preset

import presetHTML5 from '@bbob/preset-html5';

const yourOwnPreset = presetHTML5.extend((tags) => ({
  ...tags,

  yourTag: (node) => ({
    tag: 'span',
    attrs: {
      style: 'font-weight: bold'
    },
  }),
}));