2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-14 18:42:24 +03:00

chore(readme): update @bbob/html usage example

This commit is contained in:
Nikolay Kostyurin
2019-03-29 10:34:04 +02:00
parent cd2b6fd2fb
commit e4b38f289f
2 changed files with 6 additions and 6 deletions
+5 -6
View File
@@ -74,13 +74,12 @@ npm i @bbob/core @bbob/html @bbob/preset-html5
```
```js
import bbob from '@bbob/core'
import { render } from '@bbob/html'
import bbobHTML from '@bbob/html'
import presetHTML5 from '@bbob/preset-html5'
const processed = bbob(presetHTML5()).process(`[i]Text[/i]`, { render })
const processed = bbobHTML(`[i]Text[/i]`, presetHTML5())
console.log(processed.html); // <span style="font-style: italic;">Text</span>
console.log(processed); // <span style="font-style: italic;">Text</span>
```
### React usage <a name="react-usage"></a>
@@ -108,9 +107,9 @@ Its a way to transform parsed BBCode AST tree to another tree by rules in preset
import { createPreset } from '@bbob/preset'
export default createPreset({
quote: node => ({
quote: (node) => ({
tag: 'blockquote',
attrs: {},
attrs: node.attrs,
content: [{
tag: 'p',
attrs: {},