* feat: use swc.rs instead of babel
* BREAKING CHANGE: now we use swc.rs as main bundler and transpiler instead of babel
- jest now uses swc
- rollup now uses swc
* feat: benchmark now separate package with `npm start` and colored output
- benchmark as separate package with error throw if package drops performance
* feat: all lerna packages now using scripts/pkg-task
* feat(github): publish to npm and github registry
- when release was created this action automaticly publish packages to npm and github
* feat(github): move all from Travis CI to Github Actions
- code analysis and tests now using github actions
* test: increase tests coverage
- add more tests for @bbob/react, @bbob/vue2 and @bbob/parser
Augments the existing PropType for the `container` prop of Component to allow for React elements and element types to be passed. The latter allows React Native to better be supported.
* chore: initial setup for vue2 packages
* feat: basic Vue 2 Component
* feat(vue2): add more test cases
* test(preset): add more cases to test in preset
* test(preset-vue2): add more cases to test tags processing
* fix(preset): tag node checking
* test(preset-vue): more coverage for vue preset
* refactor(vue2): move default export to plugin install func
* feat(example-vue2): add vue2 example to examples folder
* chore(example-vue2): remove unused npm scripts
* chore: add vue 2 example in main README
* chore: update package.json descriptions
* feat(parser): first iteration of new lexer
* feat(parser): convert token string props to number props
* refactor(parser): optimize char grabber
* refactor(parser): working on new lexer
* refactor(parser): convert token string props to number props
* refactor(parser): rebuild lexer, add tag attrs parsing
* refactor(parser): rework word parsing and tag parsing
* refactor(parser): rework to pass tests
* refactor(parser): rework tag parsing
* refactor(parser): rework escape tags parsing
* refactor(parser): rework tests
* refactor(parser): all test pass
* refactor(parser): make lexer faster by move mode switching in loop
* refactor(parser): remove all state map objects
* refactor(parser): order of parsing states
* refactor(parser): state switching without return
* refactor(parser): rename buffers to chars
* refactor(lexer): reduce function calls
* feat(lexer): add new parser tests and code to pass it
* fix(utils): remove unused variable in char grabber
* feat(lexer): add test for new lexer bug
* chore(*): add lexer and lexer2 to benchmark
* chore(lexer): add some debug info for char grabber
* feat(parser): add new test for single attributes without values
* fix(lexer): paired tags tests
* refactor(lexer): comment breaking changes tests for future releases
* feat(core): improve tests
* refactor(parser): add more tests, reduce char grabber size
* refactor(parser): reduce utils size
* refactor(parser): remove unused code from tag parsing code
* refactor(parser): remove unused code from word to tag transforming code
* chore(benchmark): fix benchmark imports
* feat(preset-html5): add feature to filter javascript: urls
* fix(plugin-helper): escape html in attrs
* fix(plugin-helper): tests for html escape
* refactor(preset-html5): remove html escape from preset
* feat(preset): add ability to pass and extend preset options
* feat(parser): write test for only allowed tags parsing
* chore(parser): rename only allowed test
* fix(parser): only allowed tag rendering
* fix(plugin-helper): add new TagNode toString tests
When using `@bbob/react`s `<BBCode>` component, the following error is thrown
if this change is not included...
```
Warning: Each child in a list should have a unique "key" prop.
```
Mentioned in #28
You need to pass a valid prop checking function to `PropTypes.arrayOf`. This caused
an error to be thrown in development for me:
```
Warning: Failed prop type: Unexpected token function
```
* attrsToString: To avoid some malformed attributes
Error:
```
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at attrsToString
```
This errors appears if no `attrs` setted in custom tag:
```
const BBcodePresetTemp = BbobPresetHTML5.extend((tags: any) => {
tags.br = () => ({
tag: 'br',
// attrs: {}, // <-- Comment this line for error and add [br] to text
content: null,
});
return tags;
});
```
* fix(parser): fix issue with escaping backslashes when enableEscapeTags is set (#20)
there is a bug in the lexer where when enableEscapeTags is set, backslashes
are not always escaped (ie. \\[b] is treated as an escaped tag, rather than a
literal backslash, and then a tag).
* chore: v2.5.1
* feat(parse): allow tags to be escaped with backslash
adds additional option `enableEscapeTags` to `parse` and `createLexer` that
when true will parse openTag and closeTag as WORD (rather than TAG) when
proceeded with backslash