Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .changeset/tiny-dolls-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
"@bbob/parser": minor
"@bbob/types": minor
"@bbob/cli": minor
"@bbob/core": minor
"@bbob/html": minor
"@bbob/plugin-helper": minor
"@bbob/preset": minor
"@bbob/preset-html5": minor
"@bbob/preset-react": minor
"@bbob/preset-vue": minor
"@bbob/react": minor
"@bbob/vue2": minor
"@bbob/vue3": minor
---

Added `whitespaceInTags` parsing option (true by default) with this option you can disable parsing `[tags with spaces]` it will be considered as text

```js
import html5 from '@bbob/preset-html5'
import parse from '@bbob/html'

const html = parse('[b]lorem[/b] [foo bar] [i]ipsum[/i]', html5(), {
whitespaceInTags: false
})

console.log(html) // <b>lorem </b> [foo bar] <i>ipsum</i>
```

1 change: 1 addition & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
benchmark:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Pull Request
on:
# workflow_run:
# workflows:
# - Tests
# - Benchmark
# types:
# - completed
pull_request:
paths-ignore:
- '.changeset/**'
Expand Down Expand Up @@ -30,7 +36,7 @@ jobs:
- name: Set SHA
id: sha
run: |
SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")
SHORT_SHA=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT

- name: Install pnpm
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
env:
NODE_OPTIONS: --max-old-space-size=4096
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install PNPM
uses: pnpm/action-setup@v3
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ jobs:
- name: Run the lint
run: pnpm run lint

- name: Install coverage
run: pnpm install --global codecov

- name: Run the coverage
run: pnpm run cover

- name: Run the coverage
run: codecov
- name: Coveralls
uses: coverallsapp/github-action@v2
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ written in pure javascript, no dependencies

[![Tests](https://github.com/JiLiZART/BBob/actions/workflows/test.yml/badge.svg)](https://github.com/JiLiZART/BBob/actions/workflows/test.yml)
[![Benchmark](https://github.com/JiLiZART/BBob/actions/workflows/benchmark.yml/badge.svg)](https://github.com/JiLiZART/BBob/actions/workflows/benchmark.yml)
<a href="https://codecov.io/gh/JiLiZART/bbob">
<img src="https://codecov.io/gh/JiLiZART/bbob/branch/master/graph/badge.svg" alt="codecov">
</a>
<a href='https://coveralls.io/github/JiLiZART/BBob?branch=master'>
<img src='https://coveralls.io/repos/github/JiLiZART/BBob/badge.svg?branch=master' alt='Coverage Status' />
</a>
<a href="https://www.codefactor.io/repository/github/jilizart/bbob">
<img src="https://www.codefactor.io/repository/github/jilizart/bbob/badge" alt="CodeFactor">
</a>
Expand Down Expand Up @@ -230,6 +230,28 @@ const processed = bbobHTML(`[b]Text[/b]'\\[b\\]Text\\[/b\\]'`, presetHTML5(), {
console.log(processed); // <span style="font-weight: bold;">Text</span>[b]Text[/b]
```

#### caseFreeTags

Allows to parse case insensitive tags like `[h1]some[/H1]` -> `<h1>some</h1>`

```js
import bbobHTML from '@bbob/html'
import presetHTML5 from '@bbob/preset-html5'

const processed = bbobHTML(`[h1]some[/H1]`, presetHTML5(), { caseFreeTags: true })

console.log(processed); // <h1>some</h1>
```

```js
import bbobHTML from '@bbob/html'
import presetHTML5 from '@bbob/preset-html5'

const processed = bbobHTML(`[b]Text[/b]'\\[b\\]Text\\[/b\\]'`, presetHTML5(), { enableEscapeTags: true })

console.log(processed); // <span style="font-weight: bold;">Text</span>[b]Text[/b]
```


### Presets <a name="basic"></a>

Expand Down
3 changes: 1 addition & 2 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"cpupro": "node --require cpupro benchmark.js"
},
"author": {
"name": "Nikolay Kostyurin <jilizart@gmail.com>",
"url": "https://artkost.ru/"
"name": "Nikolay Kostyurin <jilizart@gmail.com>"
},
"dependencies": {
"@bbob/parser": "*",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"cleanup": "node scripts/cleanup"
},
"author": {
"name": "Nikolay Kostyurin <jilizart@gmail.com>",
"url": "https://artkost.ru/"
"name": "Nikolay Kostyurin <jilizart@gmail.com>"
},
"license": "MIT",
"devDependencies": {
Expand Down Expand Up @@ -71,7 +70,8 @@
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
"registry": "https://registry.npmjs.org/",
"provenance": true
},
"husky": {
"hooks": {
Expand Down
41 changes: 41 additions & 0 deletions packages/bbob-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Change Log

## 4.2.0

### Minor Changes

- [#251](https://github.com/JiLiZART/BBob/pull/251) [`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491) Thanks [@JiLiZART](https://github.com/JiLiZART)! - New option flag `caseFreeTags` has been added

This flag allows to parse case insensitive tags like `[h1]some[/H1]` -> `<h1>some</h1>`

```js
import html from "@bbob/html";
import presetHTML5 from "@bbob/preset-html5";

const processed = html(`[h1]some[/H1]`, presetHTML5(), {
caseFreeTags: true,
});

console.log(processed); // <h1>some</h1>
```

Also now you can pass `caseFreeTags` to `parse` function

```js
import { parse } from "@bbob/parser";

const ast = parse("[h1]some[/H1]", {
caseFreeTags: true,
});
```

BREAKING CHANGE: `isTokenNested` function now accepts string `tokenValue` instead of `token`

Changed codecov.io to coveralls.io for test coverage

### Patch Changes

- [#267](https://github.com/JiLiZART/BBob/pull/267) [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841) Thanks [@JiLiZART](https://github.com/JiLiZART)! - Fix types for BbobCoreOptions

- Updated dependencies [[`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491), [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841)]:
- @bbob/html@4.2.0
- @bbob/preset-html5@4.2.0

## 4.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bbob-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbob/cli",
"version": "4.1.1",
"version": "4.2.0",
"description": "Comand line bbcode parser",
"bin": {
"bbob": "lib/cli.js"
Expand Down
42 changes: 42 additions & 0 deletions packages/bbob-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Change Log

## 4.2.0

### Minor Changes

- [#251](https://github.com/JiLiZART/BBob/pull/251) [`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491) Thanks [@JiLiZART](https://github.com/JiLiZART)! - New option flag `caseFreeTags` has been added

This flag allows to parse case insensitive tags like `[h1]some[/H1]` -> `<h1>some</h1>`

```js
import html from "@bbob/html";
import presetHTML5 from "@bbob/preset-html5";

const processed = html(`[h1]some[/H1]`, presetHTML5(), {
caseFreeTags: true,
});

console.log(processed); // <h1>some</h1>
```

Also now you can pass `caseFreeTags` to `parse` function

```js
import { parse } from "@bbob/parser";

const ast = parse("[h1]some[/H1]", {
caseFreeTags: true,
});
```

BREAKING CHANGE: `isTokenNested` function now accepts string `tokenValue` instead of `token`

Changed codecov.io to coveralls.io for test coverage

### Patch Changes

- [#267](https://github.com/JiLiZART/BBob/pull/267) [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841) Thanks [@JiLiZART](https://github.com/JiLiZART)! - Fix types for BbobCoreOptions

- Updated dependencies [[`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491), [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841)]:
- @bbob/parser@4.2.0
- @bbob/types@4.2.0
- @bbob/plugin-helper@4.2.0

## 4.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bbob-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbob/core",
"version": "4.1.1",
"version": "4.2.0",
"description": "⚡️Blazing-fast js-bbcode-parser, bbcode js, that transforms and parses to AST with plugin support in pure javascript, no dependencies",
"keywords": [
"bbcode",
Expand Down
42 changes: 42 additions & 0 deletions packages/bbob-html/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Change Log

## 4.2.0

### Minor Changes

- [#251](https://github.com/JiLiZART/BBob/pull/251) [`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491) Thanks [@JiLiZART](https://github.com/JiLiZART)! - New option flag `caseFreeTags` has been added

This flag allows to parse case insensitive tags like `[h1]some[/H1]` -> `<h1>some</h1>`

```js
import html from "@bbob/html";
import presetHTML5 from "@bbob/preset-html5";

const processed = html(`[h1]some[/H1]`, presetHTML5(), {
caseFreeTags: true,
});

console.log(processed); // <h1>some</h1>
```

Also now you can pass `caseFreeTags` to `parse` function

```js
import { parse } from "@bbob/parser";

const ast = parse("[h1]some[/H1]", {
caseFreeTags: true,
});
```

BREAKING CHANGE: `isTokenNested` function now accepts string `tokenValue` instead of `token`

Changed codecov.io to coveralls.io for test coverage

### Patch Changes

- [#267](https://github.com/JiLiZART/BBob/pull/267) [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841) Thanks [@JiLiZART](https://github.com/JiLiZART)! - Fix types for BbobCoreOptions

- Updated dependencies [[`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491), [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841)]:
- @bbob/types@4.2.0
- @bbob/core@4.2.0
- @bbob/plugin-helper@4.2.0

## 4.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bbob-html/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbob/html",
"version": "4.1.1",
"version": "4.2.0",
"description": "A BBCode to HTML Renderer part of @bbob",
"keywords": [
"html",
Expand Down
41 changes: 41 additions & 0 deletions packages/bbob-parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Change Log

## 4.2.0

### Minor Changes

- [#251](https://github.com/JiLiZART/BBob/pull/251) [`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491) Thanks [@JiLiZART](https://github.com/JiLiZART)! - New option flag `caseFreeTags` has been added

This flag allows to parse case insensitive tags like `[h1]some[/H1]` -> `<h1>some</h1>`

```js
import html from "@bbob/html";
import presetHTML5 from "@bbob/preset-html5";

const processed = html(`[h1]some[/H1]`, presetHTML5(), {
caseFreeTags: true,
});

console.log(processed); // <h1>some</h1>
```

Also now you can pass `caseFreeTags` to `parse` function

```js
import { parse } from "@bbob/parser";

const ast = parse("[h1]some[/H1]", {
caseFreeTags: true,
});
```

BREAKING CHANGE: `isTokenNested` function now accepts string `tokenValue` instead of `token`

Changed codecov.io to coveralls.io for test coverage

### Patch Changes

- [#267](https://github.com/JiLiZART/BBob/pull/267) [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841) Thanks [@JiLiZART](https://github.com/JiLiZART)! - Fix types for BbobCoreOptions

- Updated dependencies [[`ccab54a`](https://github.com/JiLiZART/BBob/commit/ccab54a4547b67d0ea61644e36ca57fdbe8c6491), [`8a9cfd6`](https://github.com/JiLiZART/BBob/commit/8a9cfd67c0f1a9fe6cc8cd74b68b7cdf3d393841)]:
- @bbob/types@4.2.0
- @bbob/plugin-helper@4.2.0

## 4.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bbob-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbob/parser",
"version": "4.1.1",
"version": "4.2.0",
"description": "A BBCode to AST Parser part of @bbob",
"keywords": [
"bbcode",
Expand Down
Loading
Loading