2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-15 11:59:37 +03:00
Commit Graph

31 Commits

Author SHA1 Message Date
Nikolay Kost ccab54a454 feat(#250): introduce caseFreeTags option (#251)
* chore: initial tests

* feat: parser test

* feat: add case free tags support

* fix: coverage upload

* fix: --disable=gcov

* fix: npm publish sha commit

* fix: change codecov to coveralls

* fix: change workflow pr build and publish

* chore: change coverage badge [skip ci]
2024-10-16 23:26:06 +02:00
Steven Chang 40848747d4 feat: add start and end positions of tag nodes (#246)
Closes #134

* feat: Add start and end positions of tag nodes

Improves accuracy of row/col error reporting. Now targets the start of the relevant token instead of the end.

* Simplify language for TagNode and Token

* Update static TagNode.create to ingest setStart() logic

improve readability of end pos offset for no attr tags
2024-08-01 09:42:29 +02:00
Nikolay Kost 8797f7f363 feat: typescript support (#185)
* feat: initial typescript support

* feat: typescript support

* feat(plugin-helper): move files to typescript

* chore: update lock files

* feat: preset types

* fix: build

* fix: benchmark

* fix: remove pnpm cache

* fix: bench action

* fix: pnpm recursive install

* fix: nx cache

* fix: lock file

* fix: workflows

* fix: lerna support in pnpm

* fix: pnpm workspace

* fix: remove unused files

* fix: pnpm lock file

* fix: update lerna for support pnpm

* fix: lerna bootstrap

* fix: rollup build

* fix: update nx

* fix: build

* fix: add nx dep target

* fix: remove nx cache

* fix: workflow run on push only for master

* fix: test workflow run on push only for master

* fix: remove parallel for gen types

* fix: benchmark

* fix: benchmark imports

* fix: pnpm

* fix: types errors and pnpm

* fix: types

* fix: types

* refactor: parser

* fix(parser): tests

* fix: preset tests

* fix: react types

* fix: react type declarations

* fix: pnpm lock file

* fix: react preset types

* fix: lock file

* fix: vue2 types

* feat: dev container support

* fix: types

* fix: types

* refactor: rewrite pkg-task, add nx gen-types deps, fix react/render.ts

* refactor: types

* fix: types

* fix: rename gen-types to types

* fix: nx build order

* fix: nx reset

* fix: define nx deps explicit

* fix: build

* fix: nx

* fix: nx order build

* fix: nx deps

* fix: bbob cli tests

* fix: tests

* fix: cli tests and import

* fix: test cover

* fix: cli cover
2024-04-23 21:11:14 +02:00
Steven Chang 05246b2aea fix: treat contextFreeTags case insensitively (#230) 2024-04-14 16:02:29 +03:00
Nikolay Kost 0c78831372 feat(preset-html5): color tag #189, case insensitive tags #190 (#191)
* fix(preset-html5): add color tag #189

* fix(parser): case insensitive tags bug #190
2023-09-28 04:02:52 +03:00
Nikolay Kost 603c3ead0f fix: bug with lost closing tag (#186)
* fix: closing tag bug

* chore: add changeset thin-crabs-wonder.md

* chore: remove debug code

* chore: add more tests
2023-08-28 14:26:27 +02:00
Nikolay Kost 19e8dd659e feat(parser): context free tag mode (#165)
* feat(parser): initial context free tag mode

* fix: tests coverage

* chore: update readme

* chore: remove unused badge from readme
2023-01-27 05:26:09 +02:00
Nikolay Kostyurin da6709d437 feat: update core deps (#120)
* 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
2021-11-29 00:33:06 +02:00
Nikolay Kostyurin 70ff2e6660 fix(parser): dont process nested tags as string if parent is not allowed (#84)
* fix(parser): dont process nested tags as string if parent is not allowed

* fix(plugin-helper): toString method with default params
2020-12-16 23:51:28 +02:00
Nikolay Kostyurin 09bda26d7c fix(parser): tag inside tag parsing regression (#81) 2020-12-16 00:29:26 +02:00
Nikolay Kostyurin 772d422d77 feat(parser): rewrite lexer to make it faster (#50)
* 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
2020-12-09 01:03:48 +02:00
Nikolay Kostyurin a16b9f73b0 fix(parser): don't eat not allowed tags with params (#58) fixes #54
* 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
2020-04-12 21:14:52 +02:00
Nikolay Kostyurin 597c2a9008 feat(plugin-helper): lowercase resulting tag names (#42) 2019-07-28 15:28:46 +02:00
Nikolay Kostyurin b4cf27127f fix(parser): infinity loop problem when escape [\b] (#31)
With enableEscapeTags: true, when trying to write [b]test[\b] page is crashed.
Fixes #23
2019-06-30 11:15:10 +02:00
Nikolay Kostyurin c4a88e5036 chore: v2.5.1 (#21)
* 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
2019-06-18 09:56:21 +02:00
David Ferguson c4f78c1230 feat(parse): allow tags to be escaped with backslash (#17)
* 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
2019-06-17 21:29:10 +02:00
Nikolay Kostyurin 8cb1d495dd refactor(parser): better jsdoc, some behavior fixes, more tests
— all operations on nodes moved to `createList` function
- fixed problem with single tags with value only like `[url=value]` fixes #6
- write tests for `Token` class
- moved all node arrays to parse func, now parser supports many instances
- add jsdoc to critical parts of the parser to better understanding how it works
2019-03-04 02:24:12 +02:00
Nikolay Kostyurin b49b7435da feat(parser): better handlinf of unclosed tags like '[My unclosed and [closed] tag' 2018-09-24 00:33:27 +02:00
Nikolay Kostyurin 790825af30 feat(parser): custom open and close tags support, html tags tests (#3) 2018-09-18 23:41:52 +02:00
Nikolay Kostyurin 32a7fb51da refactor(*): convert to babel and generation to lib, es, dist folders (#2)
* refactor(*): convert to babel and generation to lib, es, dist

* chore(*): remove generated files

* fix(*): lint run command
2018-09-09 23:55:28 +02:00
Nikolay Kostyurin 88826512e7 feat(lexer): new lexer (#1) 2018-08-14 18:12:58 +02:00
Nikolay Kostyurin fdc05c0618 test(parser): add posthtml integration test 2018-07-30 22:49:55 +02:00
Nikolay Kostyurin 2eb83c1ad7 feat(parser): inconsistent tag detection test 2018-07-23 23:06:50 +02:00
Nikolay Kostyurin 4c8dbed95f feat(parser): optimize size 2018-07-14 01:50:33 +02:00
Nikolay Kostyurin 0bea22d3ca fix parse tags in brackets 2018-07-12 23:21:22 +02:00
Nikolay Kostyurin 7f400506d4 fix(parser): tokenizer error with quotemark strings 2018-07-11 23:37:51 +02:00
Nikolay Kostyurin d3e8e4a289 fix(parser): only allowed tags error 2018-07-11 01:10:43 +02:00
Nikolay Kostyurin 3c750d95c2 convert Parser class to set of function for better compression 2018-07-09 21:58:41 +02:00
Nikolay Kostyurin 12144415cc quoted bbcode params support, support escape backslash 2018-07-06 00:46:37 +02:00
Nikolay Kostyurin 3e15b54efa optimize Parser, remove while loop, add event to Tokenizer 2018-06-25 00:53:49 +02:00
Nikolay Kostyurin 4305289051 move test files and lib files to separate folders 2018-06-23 00:37:25 +02:00