mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-05 16:42:27 +03:00
b63864ca07
rewrite '@bbob/preset-html5' using new package selfclosed html tags now without space
25 lines
493 B
Markdown
25 lines
493 B
Markdown
#@bbob/preset
|
|
Base function for create presets to process bbcode AST to HTML or Framework specific tags
|
|
|
|
## Install
|
|
|
|
```bash
|
|
npm i @bbob/preset
|
|
```
|
|
### API
|
|
|
|
**For plain HTML**
|
|
|
|
```js
|
|
import { createPreset } from '@bbob/core'
|
|
|
|
import { createPreset } from '@bbob/preset'
|
|
|
|
const options = {
|
|
onlyAllowTags: ['url', 'h'],
|
|
onError: (err) => console.warn(err.message, err.lineNumber, err.columnNumber)
|
|
};
|
|
const pre = parse('[url=https://github.com]hello world![/url]', options)
|
|
```
|
|
## Usage
|