diff options
| author | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
|---|---|---|
| committer | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
| commit | 7a52ddeba2a68388b544f529d2d92104420f77b0 (patch) | |
| tree | 15ddd47457a2cb4a96060747437d36474e4f6b4e /node_modules/posthtml-render | |
| parent | 53d6ae2b5568437afa5e4995580a3fb679b7b91b (diff) | |
Changed from static to 11ty!
Diffstat (limited to 'node_modules/posthtml-render')
| -rw-r--r-- | node_modules/posthtml-render/changelog.md | 310 | ||||
| -rw-r--r-- | node_modules/posthtml-render/dist/index.d.ts | 67 | ||||
| -rw-r--r-- | node_modules/posthtml-render/dist/index.js | 1 | ||||
| -rw-r--r-- | node_modules/posthtml-render/license | 22 | ||||
| -rw-r--r-- | node_modules/posthtml-render/package.json | 55 | ||||
| -rw-r--r-- | node_modules/posthtml-render/readme.md | 225 |
6 files changed, 680 insertions, 0 deletions
diff --git a/node_modules/posthtml-render/changelog.md b/node_modules/posthtml-render/changelog.md new file mode 100644 index 0000000..ec21823 --- /dev/null +++ b/node_modules/posthtml-render/changelog.md @@ -0,0 +1,310 @@ +## 3.0.0 (2021-07-27) + +* style: after lint ([d3d9d8b](https://github.com/posthtml/posthtml-render/commit/d3d9d8b)) +* style: indent ([3d1fe36](https://github.com/posthtml/posthtml-render/commit/3d1fe36)) +* build: update dep dev ([332eef4](https://github.com/posthtml/posthtml-render/commit/332eef4)) +* docs: update usage ([d80591f](https://github.com/posthtml/posthtml-render/commit/d80591f)) +* refactor: export as not default render, close #63 ([f45d8ed](https://github.com/posthtml/posthtml-render/commit/f45d8ed)), closes [#63](https://github.com/posthtml/posthtml-render/issues/63) +* perf: move types to index ([7431c0f](https://github.com/posthtml/posthtml-render/commit/7431c0f)) +* perf: remove trash ([fa85549](https://github.com/posthtml/posthtml-render/commit/fa85549)) +* fix: referenced incorrectly in package.json close #62 ([d0bd697](https://github.com/posthtml/posthtml-render/commit/d0bd697)), closes [#62](https://github.com/posthtml/posthtml-render/issues/62) + + + +## <small>2.0.6 (2021-06-11)</small> + +* 2.0.6 ([aa66af1](https://github.com/posthtml/posthtml-render/commit/aa66af1)) +* style: ignore ts error ([aaab81d](https://github.com/posthtml/posthtml-render/commit/aaab81d)) +* fix: incorrect detect json format ([c334ef2](https://github.com/posthtml/posthtml-render/commit/c334ef2)) +* fix: is-json not declare ([85b7bec](https://github.com/posthtml/posthtml-render/commit/85b7bec)) +* build: update depdev ([76c0752](https://github.com/posthtml/posthtml-render/commit/76c0752)) +* test: change to number with quote ([e2f6cb5](https://github.com/posthtml/posthtml-render/commit/e2f6cb5)) + + + +## <small>2.0.5 (2021-06-10)</small> + +* 2.0.5 ([efc4a41](https://github.com/posthtml/posthtml-render/commit/efc4a41)) +* test: for long test ([d019534](https://github.com/posthtml/posthtml-render/commit/d019534)) +* test: invalid in htmlnano travis ([69d666b](https://github.com/posthtml/posthtml-render/commit/69d666b)) +* test: more tests ([4dfa92e](https://github.com/posthtml/posthtml-render/commit/4dfa92e)) +* test: off only one test ([fcdda46](https://github.com/posthtml/posthtml-render/commit/fcdda46)) +* fix: empty and false content, close #58 ([af9d828](https://github.com/posthtml/posthtml-render/commit/af9d828)), closes [#58](https://github.com/posthtml/posthtml-render/issues/58) + + + +## <small>2.0.4 (2021-06-08)</small> + +* 2.0.4 ([698e31f](https://github.com/posthtml/posthtml-render/commit/698e31f)) +* perf: engine up to 12 version ([7c430be](https://github.com/posthtml/posthtml-render/commit/7c430be)) +* fix: if tree contains empty string, close #58 ([401f5a6](https://github.com/posthtml/posthtml-render/commit/401f5a6)), closes [#58](https://github.com/posthtml/posthtml-render/issues/58) +* test: if tree exists empty string, issue #58 ([3493d4f](https://github.com/posthtml/posthtml-render/commit/3493d4f)), closes [#58](https://github.com/posthtml/posthtml-render/issues/58) + + + +## <small>2.0.3 (2021-06-04)</small> + +* 2.0.3 ([f5cd69d](https://github.com/posthtml/posthtml-render/commit/f5cd69d)) +* test: if in content has empty array, issue #56 ([95bad06](https://github.com/posthtml/posthtml-render/commit/95bad06)), closes [#56](https://github.com/posthtml/posthtml-render/issues/56) +* fix: if in content has empty array, close #56 ([892d602](https://github.com/posthtml/posthtml-render/commit/892d602)), closes [#56](https://github.com/posthtml/posthtml-render/issues/56) + + + +## <small>2.0.2 (2021-06-03)</small> + +* 2.0.2 ([bcbdc60](https://github.com/posthtml/posthtml-render/commit/bcbdc60)) +* fix: concate single tag ([a6764cf](https://github.com/posthtml/posthtml-render/commit/a6764cf)) +* test: fix only one test ([60f598d](https://github.com/posthtml/posthtml-render/commit/60f598d)) + + + +## <small>2.0.1 (2021-05-24)</small> + +* 2.0.1 ([feb426c](https://github.com/posthtml/posthtml-render/commit/feb426c)) +* ci: drop support old node ([810c46c](https://github.com/posthtml/posthtml-render/commit/810c46c)) +* ci: lock ([3c894d6](https://github.com/posthtml/posthtml-render/commit/3c894d6)) +* build: add prepare script, close #53 ([dbc9b47](https://github.com/posthtml/posthtml-render/commit/dbc9b47)), closes [#53](https://github.com/posthtml/posthtml-render/issues/53) +* test: for string template ([1047ce5](https://github.com/posthtml/posthtml-render/commit/1047ce5)) +* docs: typo ([fae9dad](https://github.com/posthtml/posthtml-render/commit/fae9dad)) + + + +## <small>1.3.1 (2021-03-12)</small> + +* 1.3.1 ([b59d962](https://github.com/posthtml/posthtml-render/commit/b59d962)) +* build: update dep dev ([acf654b](https://github.com/posthtml/posthtml-render/commit/acf654b)) +* test: Case sensitivity breaks empty elements, issue #49 ([041774c](https://github.com/posthtml/posthtml-render/commit/041774c)), closes [#49](https://github.com/posthtml/posthtml-render/issues/49) +* test: Case sensitivity breaks empty elements, issue #49 ([16b00d4](https://github.com/posthtml/posthtml-render/commit/16b00d4)), closes [#49](https://github.com/posthtml/posthtml-render/issues/49) +* test: remove undefined write ([9d22fff](https://github.com/posthtml/posthtml-render/commit/9d22fff)) +* fix: case sensitivity breaks empty elements, close #49 ([1a87466](https://github.com/posthtml/posthtml-render/commit/1a87466)), closes [#49](https://github.com/posthtml/posthtml-render/issues/49) +* docs: remove unused badges ([903037c](https://github.com/posthtml/posthtml-render/commit/903037c)) + + + +## 2.0.0 (2021-05-07) + +* 2.0.0 ([3c898d4](https://github.com/posthtml/posthtml-render/commit/3c898d4)) +* docs: description node property closeAs, issue #48 ([5979fc9](https://github.com/posthtml/posthtml-render/commit/5979fc9)), closes [#48](https://github.com/posthtml/posthtml-render/issues/48) +* type: add node property closeAs, issue #48 ([00ec9b0](https://github.com/posthtml/posthtml-render/commit/00ec9b0)), closes [#48](https://github.com/posthtml/posthtml-render/issues/48) +* test: JSON strings in data attributes, #46 ([d0508e2](https://github.com/posthtml/posthtml-render/commit/d0508e2)), closes [#46](https://github.com/posthtml/posthtml-render/issues/46) +* test: node property closeAs, issue #48 ([f561e6b](https://github.com/posthtml/posthtml-render/commit/f561e6b)), closes [#48](https://github.com/posthtml/posthtml-render/issues/48) +* feat: add node property closeAs, close #48 ([6892ede](https://github.com/posthtml/posthtml-render/commit/6892ede)), closes [#48](https://github.com/posthtml/posthtml-render/issues/48) +* feat: JSON strings in data attributes, close #46 ([5539187](https://github.com/posthtml/posthtml-render/commit/5539187)), closes [#46](https://github.com/posthtml/posthtml-render/issues/46) +* merge: from master ([3ab5e82](https://github.com/posthtml/posthtml-render/commit/3ab5e82)) +* refactor: migrate to typescript ([9eaaca4](https://github.com/posthtml/posthtml-render/commit/9eaaca4)) + + + +## <small>1.3.1 (2021-03-12)</small> + +* 1.3.1 ([b59d962](https://github.com/posthtml/posthtml-render/commit/b59d962)) +* Delete test.html ([0dea643](https://github.com/posthtml/posthtml-render/commit/0dea643)) +* Update funding.yml ([86f2c9d](https://github.com/posthtml/posthtml-render/commit/86f2c9d)) +* build: update dep dev ([acf654b](https://github.com/posthtml/posthtml-render/commit/acf654b)) +* test: Case sensitivity breaks empty elements, issue #49 ([041774c](https://github.com/posthtml/posthtml-render/commit/041774c)), closes [#49](https://github.com/posthtml/posthtml-render/issues/49) +* test: Case sensitivity breaks empty elements, issue #49 ([16b00d4](https://github.com/posthtml/posthtml-render/commit/16b00d4)), closes [#49](https://github.com/posthtml/posthtml-render/issues/49) +* test: quoteStyle option ([18d31c0](https://github.com/posthtml/posthtml-render/commit/18d31c0)) +* test: remove undefined write ([9d22fff](https://github.com/posthtml/posthtml-render/commit/9d22fff)) +* fix: case sensitivity breaks empty elements, close #49 ([1a87466](https://github.com/posthtml/posthtml-render/commit/1a87466)), closes [#49](https://github.com/posthtml/posthtml-render/issues/49) +* docs: add quoteStyle option ([38b2b04](https://github.com/posthtml/posthtml-render/commit/38b2b04)) +* docs: remove unused badges ([903037c](https://github.com/posthtml/posthtml-render/commit/903037c)) +* feat: add type definition for quoteStyle ([3ee8d58](https://github.com/posthtml/posthtml-render/commit/3ee8d58)) +* feat: implement quoteStyle option ([903300f](https://github.com/posthtml/posthtml-render/commit/903300f)) + + + +## 1.3.0 (2020-11-12) + +* 1.3.0 ([334705d](https://github.com/posthtml/posthtml-render/commit/334705d)) +* ci: package lock for ci ([4c85131](https://github.com/posthtml/posthtml-render/commit/4c85131)) +* ci: remove windows ([34aa3c2](https://github.com/posthtml/posthtml-render/commit/34aa3c2)) +* docs: add description for replaceQuote ([44ab8b0](https://github.com/posthtml/posthtml-render/commit/44ab8b0)) +* style: after lint ([c944f82](https://github.com/posthtml/posthtml-render/commit/c944f82)) +* reaftor: build sustem ([b63ec4e](https://github.com/posthtml/posthtml-render/commit/b63ec4e)) +* feat: replaceQuote, close #43 ([00927c3](https://github.com/posthtml/posthtml-render/commit/00927c3)), closes [#43](https://github.com/posthtml/posthtml-render/issues/43) +* test: not replace quote in arribute, issue #43 ([ccb7d23](https://github.com/posthtml/posthtml-render/commit/ccb7d23)), closes [#43](https://github.com/posthtml/posthtml-render/issues/43) + + + +## <small>1.2.3 (2020-07-28)</small> + +* chore: adds typescript type definition ([8e69f1d](https://github.com/posthtml/posthtml-render/commit/8e69f1d)) +* chore(release): 1.2.3 ([397e00b](https://github.com/posthtml/posthtml-render/commit/397e00b)) +* build(deps-dev): bump standard-version from 7.1.0 to 8.0.1 ([fe1be76](https://github.com/posthtml/posthtml-render/commit/fe1be76)) +* build(package): update dep dev ([98281b2](https://github.com/posthtml/posthtml-render/commit/98281b2)) + + + +## <small>1.2.2 (2020-04-16)</small> + +* chore(release): 1.2.2 ([2f88db9](https://github.com/posthtml/posthtml-render/commit/2f88db9)) +* revert: because yarn by default respects the engine ([1ff7911](https://github.com/posthtml/posthtml-render/commit/1ff7911)) + + + +## <small>1.2.1 (2020-04-14)</small> + +* chore(release): 1.2.1 ([dd09a17](https://github.com/posthtml/posthtml-render/commit/dd09a17)) +* fix: illegal addition of custom tags ([f936272](https://github.com/posthtml/posthtml-render/commit/f936272)) +* docs: add keeping tags unquoted ([35a3c9d](https://github.com/posthtml/posthtml-render/commit/35a3c9d)) +* docs: fix node url ([0049dca](https://github.com/posthtml/posthtml-render/commit/0049dca)) +* build: frop support old node ([714f42f](https://github.com/posthtml/posthtml-render/commit/714f42f)) +* ci: drop support old node ([5f6bef8](https://github.com/posthtml/posthtml-render/commit/5f6bef8)) + + + +## 1.2.0 (2020-02-25) + +* chore: 100% coveralls ([3ede092](https://github.com/posthtml/posthtml-render/commit/3ede092)) +* chore(release): 1.2.0 ([5d53868](https://github.com/posthtml/posthtml-render/commit/5d53868)) +* style: after lint ([bb22948](https://github.com/posthtml/posthtml-render/commit/bb22948)) +* build: update dep dev ([53a7af4](https://github.com/posthtml/posthtml-render/commit/53a7af4)) +* Add support for keeping tags unquoted. ([3492483](https://github.com/posthtml/posthtml-render/commit/3492483)) +* Fix rendering of unquoted empty attributes. ([3d1d99c](https://github.com/posthtml/posthtml-render/commit/3d1d99c)) +* perf: extra performance ([f118d98](https://github.com/posthtml/posthtml-render/commit/f118d98)) +* docs: fix node support badges ([53d7464](https://github.com/posthtml/posthtml-render/commit/53d7464)) + + + +## <small>1.1.5 (2019-05-06)</small> + +* chore(release): 1.1.5 ([c9817b4](https://github.com/posthtml/posthtml-render/commit/c9817b4)) +* ci: change script to run coveralls ([860f58b](https://github.com/posthtml/posthtml-render/commit/860f58b)) +* ci: try fix coveralls ([2f69283](https://github.com/posthtml/posthtml-render/commit/2f69283)) +* ci: try fix coveralls ([e615e69](https://github.com/posthtml/posthtml-render/commit/e615e69)) +* build: add lint pretest ([bece65d](https://github.com/posthtml/posthtml-render/commit/bece65d)) +* build: update depDev ([f6a6b85](https://github.com/posthtml/posthtml-render/commit/f6a6b85)) +* style: according standard ([85f914a](https://github.com/posthtml/posthtml-render/commit/85f914a)) +* perf: drop support old nodejs ([4663c4d](https://github.com/posthtml/posthtml-render/commit/4663c4d)) +* fix: cut out content, close #25 ([03acfa8](https://github.com/posthtml/posthtml-render/commit/03acfa8)), closes [#25](https://github.com/posthtml/posthtml-render/issues/25) +* test: fail with options closingSingleTag slash, #25 ([8be0ded](https://github.com/posthtml/posthtml-render/commit/8be0ded)), closes [#25](https://github.com/posthtml/posthtml-render/issues/25) +* Fix readme section about 'closingSingleTag' ([ce4144f](https://github.com/posthtml/posthtml-render/commit/ce4144f)) + + + +## <small>1.1.4 (2018-05-11)</small> + +* chore(release): 1.1.4 ([7999cc8](https://github.com/posthtml/posthtml-render/commit/7999cc8)) +* Add test on double quotes in attribute values ([cd277a5](https://github.com/posthtml/posthtml-render/commit/cd277a5)) +* Fix rendering double quotes in html attributes ([3a6eb19](https://github.com/posthtml/posthtml-render/commit/3a6eb19)) + + + +## <small>1.1.3 (2018-04-04)</small> + +* chore(CODEOWNERS): fix username (`@GitScrum` => `@Scrum`) ([f9f9c0a](https://github.com/posthtml/posthtml-render/commit/f9f9c0a)) +* chore(release): 1.1.3 ([bbc4e73](https://github.com/posthtml/posthtml-render/commit/bbc4e73)) +* fix(lib/index): don't handle `<component>` as self-closing tag ([c48a2e2](https://github.com/posthtml/posthtml-render/commit/c48a2e2)) + + + +## <small>1.1.2 (2018-03-20)</small> + +* chore(package): remove clean script - not use ([df85eb0](https://github.com/posthtml/posthtml-render/commit/df85eb0)) +* chore(package): remove run script build in release script ([7e8c096](https://github.com/posthtml/posthtml-render/commit/7e8c096)) +* chore(release): 1.1.2 ([4cd2b4a](https://github.com/posthtml/posthtml-render/commit/4cd2b4a)) +* delete browser.min.js ([c1d766b](https://github.com/posthtml/posthtml-render/commit/c1d766b)) +* remove `browser` ([658ef38](https://github.com/posthtml/posthtml-render/commit/658ef38)) + + + +## <small>1.1.1 (2018-03-02)</small> + +* chore(.editorconfig): use 2 spaces as `indent_size` ([7359ae4](https://github.com/posthtml/posthtml-render/commit/7359ae4)) +* chore(.github): add `CODEOWNERS` ([0270bb6](https://github.com/posthtml/posthtml-render/commit/0270bb6)) +* chore(.github): add `ISSUE_TEMPLATE` ([25fcd58](https://github.com/posthtml/posthtml-render/commit/25fcd58)) +* chore(.github): add `PULL_REQUEST_TEMPLATE` ([94416b8](https://github.com/posthtml/posthtml-render/commit/94416b8)) +* chore(.gitignore): add `nyc_output` ([ed05dda](https://github.com/posthtml/posthtml-render/commit/ed05dda)) +* chore(.npmignore): add `.nyc_output` && coverage ([0ca896d](https://github.com/posthtml/posthtml-render/commit/0ca896d)) +* chore(.npmrc): don't generate a lockfile ([4674906](https://github.com/posthtml/posthtml-render/commit/4674906)) +* chore(package): update dependencies ([ad8f1d4](https://github.com/posthtml/posthtml-render/commit/ad8f1d4)) +* chore(release): 1.1.1 ([0361296](https://github.com/posthtml/posthtml-render/commit/0361296)) +* style: fix lint report ([4539ef5](https://github.com/posthtml/posthtml-render/commit/4539ef5)) +* style: use `standard` ([90b29ea](https://github.com/posthtml/posthtml-render/commit/90b29ea)) +* refactor(lib): remove module wrapper && minor cleanups ([aed12f3](https://github.com/posthtml/posthtml-render/commit/aed12f3)) +* test: refactor ([54562b4](https://github.com/posthtml/posthtml-render/commit/54562b4)) +* build(rollup.config.js): use `rollup` for browser builds ([0b17496](https://github.com/posthtml/posthtml-render/commit/0b17496)) +* docs(LICENSE): update year ([cb3b09e](https://github.com/posthtml/posthtml-render/commit/cb3b09e)) +* docs(README): standardize ([9daa9e0](https://github.com/posthtml/posthtml-render/commit/9daa9e0)) +* docs(RENDER): init JSDoc ([8066597](https://github.com/posthtml/posthtml-render/commit/8066597)) +* ci(.travis): add node `stable` && `lts` ([f783b90](https://github.com/posthtml/posthtml-render/commit/f783b90)) + + + +## 1.1.0 (2018-01-18) + +* v1.1.0 ([488fb69](https://github.com/posthtml/posthtml-render/commit/488fb69)) +* build: rebuild mini ([53bbf3a](https://github.com/posthtml/posthtml-render/commit/53bbf3a)) +* feat: allow regexps in singleTags option ([e4308c9](https://github.com/posthtml/posthtml-render/commit/e4308c9)) + + + +## <small>1.0.7 (2018-01-18)</small> + +* Create MAINTAINERS ([2960f4b](https://github.com/posthtml/posthtml-render/commit/2960f4b)) +* Update README.md ([0948079](https://github.com/posthtml/posthtml-render/commit/0948079)) +* v1.0.7 ([508e094](https://github.com/posthtml/posthtml-render/commit/508e094)) +* ci: try fix ([0719812](https://github.com/posthtml/posthtml-render/commit/0719812)) +* jsdoc: parse -> render ([a8f5d5d](https://github.com/posthtml/posthtml-render/commit/a8f5d5d)) + + + +## <small>1.0.6 (2016-02-29)</small> + +* 1.0.6 ([f72923c](https://github.com/posthtml/posthtml-render/commit/f72923c)) +* fix immutable tree obj ([485e7fe](https://github.com/posthtml/posthtml-render/commit/485e7fe)) + + + +## <small>1.0.5 (2015-12-18)</small> + +* 1.0.5 ([2a81c32](https://github.com/posthtml/posthtml-render/commit/2a81c32)) +* fix render empty string attrs keys ([c47064b](https://github.com/posthtml/posthtml-render/commit/c47064b)) + + + +## <small>1.0.4 (2015-11-29)</small> + +* 1.0.4 ([7557c70](https://github.com/posthtml/posthtml-render/commit/7557c70)) +* fix when array in content ([12bde13](https://github.com/posthtml/posthtml-render/commit/12bde13)) + + + +## <small>1.0.3 (2015-10-25)</small> + +* 1.0.3 ([afa7021](https://github.com/posthtml/posthtml-render/commit/afa7021)) +* add npm scripts ([820d005](https://github.com/posthtml/posthtml-render/commit/820d005)) +* fix render empty key attrs & number attrs key ([7a74dd6](https://github.com/posthtml/posthtml-render/commit/7a74dd6)) + + + +## <small>1.0.2 (2015-10-21)</small> + +* no render false attrs ([0c76236](https://github.com/posthtml/posthtml-render/commit/0c76236)) +* Release v1.0.2 ([7faa900](https://github.com/posthtml/posthtml-render/commit/7faa900)) + + + +## <small>1.0.1 (2015-10-20)</small> + +* fix readme after transfer ([0dd2fdd](https://github.com/posthtml/posthtml-render/commit/0dd2fdd)) +* more tests ([f061c65](https://github.com/posthtml/posthtml-render/commit/f061c65)) +* Release v1.0.1 ([02674c2](https://github.com/posthtml/posthtml-render/commit/02674c2)) +* render number & fix skip tag false ([0dce005](https://github.com/posthtml/posthtml-render/commit/0dce005)) + + + +## 1.0.0 (2015-10-19) + +* add badge ([bf092f4](https://github.com/posthtml/posthtml-render/commit/bf092f4)) +* add module wrapper ([36f506b](https://github.com/posthtml/posthtml-render/commit/36f506b)) +* add package.json ([0837e12](https://github.com/posthtml/posthtml-render/commit/0837e12)) +* basic tests ([cffae42](https://github.com/posthtml/posthtml-render/commit/cffae42)) +* Initial commit ([18bd42f](https://github.com/posthtml/posthtml-render/commit/18bd42f)) +* Release 1.0.0 ([35699e6](https://github.com/posthtml/posthtml-render/commit/35699e6)) +* upd jscs config ([64b9f1a](https://github.com/posthtml/posthtml-render/commit/64b9f1a)) +* upd Readme & add License file ([6036ea9](https://github.com/posthtml/posthtml-render/commit/6036ea9)) +* feat(*): tests ([7ca52d5](https://github.com/posthtml/posthtml-render/commit/7ca52d5)) + + + diff --git a/node_modules/posthtml-render/dist/index.d.ts b/node_modules/posthtml-render/dist/index.d.ts new file mode 100644 index 0000000..5c05436 --- /dev/null +++ b/node_modules/posthtml-render/dist/index.d.ts @@ -0,0 +1,67 @@ +import { NodeText, NodeTag } from 'posthtml-parser'; + +declare enum quoteStyleEnum { + Smart = 0, + Single = 1, + Double = 2 +} +declare enum closingSingleTagOptionEnum { + tag = "tag", + slash = "slash", + default = "default", + closeAs = "closeAs" +} +declare enum closingSingleTagTypeEnum { + tag = "tag", + slash = "slash", + default = "default" +} +declare type Node = NodeText | NodeTag & { + closeAs?: closingSingleTagTypeEnum; +}; +declare type Options = { + /** + * Custom single tags (selfClosing). + * + * @default [] + */ + singleTags?: Array<string | RegExp>; + /** + * Closing format for single tag. + * + * Formats: + * + * tag: `<br></br>`, slash: `<br />`, default: `<br>` + * + */ + closingSingleTag?: closingSingleTagOptionEnum; + /** + * If all attributes should be quoted. + * Otherwise attributes will be unquoted when allowed. + * + * @default true + */ + quoteAllAttributes?: boolean; + /** + * Replaces quotes in attribute values with `"e;`. + * + * @default true + */ + replaceQuote?: boolean; + /** + * Quote style + * + * 0 - Smart quotes + * <img src="https://example.com/example.png" onload='testFunc("test")'> + * 1 - Single quotes + * <img src='https://example.com/example.png' onload='testFunc("test")'> + * 2 - double quotes + * <img src="https://example.com/example.png" onload="testFunc("test")"> + * + * @default 2 + */ + quoteStyle?: quoteStyleEnum; +}; +declare function render(tree?: Node | Node[], options?: Options): string; + +export { Node, Options, closingSingleTagOptionEnum, closingSingleTagTypeEnum, quoteStyleEnum, render }; diff --git a/node_modules/posthtml-render/dist/index.js b/node_modules/posthtml-render/dist/index.js new file mode 100644 index 0000000..b2889e3 --- /dev/null +++ b/node_modules/posthtml-render/dist/index.js @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var I=Object.defineProperty,U=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=(o,r,n)=>r in o?I(o,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[r]=n,b=(o,r)=>{for(var n in r||(r={}))j.call(r,n)&&g(o,n,r[n]);if(N)for(var n of N(r))v.call(r,n)&&g(o,n,r[n]);return o},R=(o,r)=>U(o,_(r));var _isjson = require('is-json'); var _isjson2 = _interopRequireDefault(_isjson);var $;(function(s){s[s.Smart=0]="Smart",s[s.Single=1]="Single",s[s.Double=2]="Double"})($||($= exports.quoteStyleEnum ={}));var d;(function(c){c.tag="tag",c.slash="slash",c.default="default",c.closeAs="closeAs"})(d||(d= exports.closingSingleTagOptionEnum ={}));var i;(function(s){s.tag="tag",s.slash="slash",s.default="default"})(i||(i= exports.closingSingleTagTypeEnum ={}));var y=["area","base","br","col","command","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],L=/[\t\n\f\r "'`=<>]/,B={closingSingleTag:void 0,quoteAllAttributes:!0,replaceQuote:!0,quoteStyle:2};function q(o,r={}){var x;let n=y;r.singleTags&&(n=[...new Set([...y,...r.singleTags])]),r=R(b(b({},B),r),{singleTags:n});let{singleTags:s,closingSingleTag:c,quoteAllAttributes:k,replaceQuote:Q,quoteStyle:p}=r,h=(x=s==null?void 0:s.filter(a=>a instanceof RegExp))!=null?x:[];return Array.isArray(o)||(o||(o=""),o=[o]),u(o);function u(a){let t="";for(let e of a){if(e===!1||e===void 0||e===null||typeof e=="string"&&e.length===0||Number.isNaN(e))continue;if(Array.isArray(e)){if(e.length===0)continue;t+=u(e);continue}if(typeof e=="string"||typeof e=="number"){t+=e;continue}if(Array.isArray(e.content)||(e.content||(e.content=""),e.content=[e.content]),e.tag===!1){t+=u(e.content);continue}let f=typeof e.tag=="string"?e.tag:"div";t+=`<${f}`,e.attrs&&(t+=w(e.attrs));let l={[i.tag]:`></${f}>`,[i.slash]:" />",[i.default]:">"};if(m(f)){switch(c){case d.tag:t+=l[i.tag];break;case d.slash:t+=l[i.slash];break;case d.closeAs:t+=l[e.closeAs?i[e.closeAs]:i.default];break;default:t+=l[i.default]}e.content&&(t+=u(e.content))}else if(c===d.closeAs&&e.closeAs){let D=e.closeAs?i[e.closeAs]:i.default;t+=`${l[D]}${u(e.content)}`}else t+=`>${u(e.content)}</${f}>`}return t}function m(a){return h.length>0?h.some(t=>t.test(a)):!!(s==null?void 0:s.includes(a.toLowerCase()))}function w(a){let t="";for(let[e,f]of Object.entries(a))if(typeof f=="string")if(_isjson2.default.call(void 0, f))t+=A(e,f);else if(k||L.test(f)){let l=f;Q&&(l=f.replace(/"/g,""")),t+=A(e,l,p)}else f===""?t+=` ${e}`:t+=` ${e}=${f}`;else f===!0?t+=` ${e}`:typeof f=="number"&&(t+=A(e,f,p));return t}function A(a,t,e=1){return e===1?` ${a}='${t}'`:e===2?` ${a}="${t}"`:typeof t=="string"&&t.includes('"')?` ${a}='${t}'`:` ${a}="${t}"`}}exports.closingSingleTagOptionEnum = d; exports.closingSingleTagTypeEnum = i; exports.quoteStyleEnum = $; exports.render = q; diff --git a/node_modules/posthtml-render/license b/node_modules/posthtml-render/license new file mode 100644 index 0000000..a835316 --- /dev/null +++ b/node_modules/posthtml-render/license @@ -0,0 +1,22 @@ +License (MIT) + +Copyright (c) 2017 Ivan Voischev <voischev.ivan@ya.ru> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/posthtml-render/package.json b/node_modules/posthtml-render/package.json new file mode 100644 index 0000000..97f9311 --- /dev/null +++ b/node_modules/posthtml-render/package.json @@ -0,0 +1,55 @@ +{ + "name": "posthtml-render", + "version": "3.0.0", + "description": "Renders PostHTML Tree to HTML/XML", + "license": "MIT", + "repository": "posthtml/posthtml-render", + "author": "Ivan Voischev <voischev.ivan@ya.ru>", + "main": "dist/index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "version": "conventional-changelog -i changelog.md -s -r 0 && git add changelog.md", + "build": "rm -rf dist && tsup src/*.ts --dts --minify", + "dev": "npm run build -- --watch", + "test": "xo && c8 ava", + "pretest": "clinton", + "prepare": "npm run build" + }, + "files": [ + "dist" + ], + "keywords": [ + "posthtml", + "render", + "html", + "xml" + ], + "dependencies": { + "is-json": "^2.0.1" + }, + "devDependencies": { + "@antfu/eslint-config-ts": "^0.7.0", + "@commitlint/cli": "^13.1.0", + "@commitlint/config-angular": "^13.1.0", + "@types/node": "^16.4.3", + "ava": "^3.13.0", + "c8": "^7.7.3", + "clinton": "^0.14.0", + "conventional-changelog-cli": "^2.0.34", + "esbuild-register": "^2.6.0", + "eslint": "^7.31.0", + "esm": "^3.2.25", + "husky": "^7.0.1", + "lint-staged": "^11.1.1", + "posthtml-parser": "^0.9.1", + "rewire": "^5.0.0", + "rimraf": "^3.0.0", + "ts-node": "^10.1.0", + "tsup": "^4.12.5", + "typescript": "^4.3.5", + "xo": "^0.42.0" + }, + "types": "dist/index.d.ts" +} diff --git a/node_modules/posthtml-render/readme.md b/node_modules/posthtml-render/readme.md new file mode 100644 index 0000000..066f37d --- /dev/null +++ b/node_modules/posthtml-render/readme.md @@ -0,0 +1,225 @@ +[![npm][npm]][npm-url] +[![node]]() +[![tests][tests]][tests-url] +[![coverage][cover]][cover-url] + +<div align="center"> + <a href="https://github.com/posthtml/posthtml"> + <img width="200" height="200" alt="PostHTML" + src="http://posthtml.github.io/posthtml/logo.svg"> + </a> + <h1>PostHTML Render</h1> + <p>Renders a PostHTML Tree to HTML/XML</p> +</div> + +<h2 align="center">Install</h2> + +```bash +npm i -D posthtml-render +``` + +<h2 align="center">Usage</h2> + +### `NodeJS` + +```js +import { render } from ''posthtml-render; + +const tree = []; + +const node = {}; + +node.tag = 'ul'; +node.attrs = { class: 'list' }; +node.content = [ + 'one', + 'two', + 'three' +].map((content) => ({ tag: 'li', content })); + +tree.push(node); + +const html = render(tree, options); + +``` + +```html +<ul class="list"> + <li>one</li> + <li>two</li> + <li>three</li> +</ul> +``` + +<h2 align="center">Options</h2> + +|Name|Type|Default|Description| +|:--:|:--:|:-----:|:----------| +|**[`singleTags`](#singletags)**|`{Array<String\|RegExp>}`|`[]`|Specify custom single tags (self closing)| +|**[`closingSingleTag`](#closingSingleTag)**|`{String}`|[`>`](#default)|Specify the single tag closing format| +|**[`quoteAllAttributes`](#quoteAllAttributes)**|`{Boolean}`|[`true`](#default)|Put double quotes around all tags, even when not necessary.| +|**[`replaceQuote`](#replaceQuote)**|`{Boolean}`|[`true`](#default)|Replaces quotes in attribute values with `"e;`.| +|**[`quoteStyle`](#quoteStyle)**|`{0 or 1 or 2}`|[`2`](#default)|Specify the style of quote arround the attribute values| + +### `singleTags` + +Specify custom single tags (self closing) + +### `{String}` + +```js +const render = require('posthtml-render') + +const tree = [ { tag: 'name' } ] +const options = { singleTags: [ 'name' ] } + +const html = render(tree, options) +``` + +**result.html** +```html +<name> +``` + +#### `{RegExp}` + +```js +const render = require('posthtml-render') + +const tree = [ { tag: '%=title%' } ] +const options = { singleTags: [ /^%.*%$/ ] } + +const html = render(tree, options) +``` + +**result.html** +```html +<%=title%> +``` + +### `closingSingleTag` + +Specify the single tag closing format + +#### `Formats` + +```js +const render = require('posthtml-render') + +const tree = [ { tag: 'img' } ] +``` + +##### `'tag'` + +```js +const html = render(tree, { closingSingleTag: 'tag' }) +``` + +```html +<custom></custom> +``` + +##### `'slash'` + +```js +const html = render(tree, { closingSingleTag: 'slash' }) +``` + +```html +<custom /> +``` + +##### `'default' (Default)` + +```js +const html = render(tree) +``` + +```html +<img> +``` + +##### `'closeAs'` + +```js +const tree = [ { + tag: 'custom', + closeAs: 'default' // Available types: `tag` | `slash` | `default` +} ] +const html = render(tree, { closingSingleTag: 'closeAs' }) +``` + +```html +<custom> +``` + +### `quoteAllAttributes` + +Specify if all attributes should be quoted. + +##### `true (Default)` + +```html +<i src="index.js"></i> +``` + +##### `false` + +```html +<i src=index.js></i> +``` + +### `replaceQuote` + +Replaces quotes in attribute values with `"e;`. + +##### `true (Default)` + +```html +<img src="<?php echo $foo["e;bar"e;] ?>"> +``` + +##### `false` + +```html +<img src="<?php echo $foo["bar"] ?>"> +``` + +### `quoteStyle` + +##### `2 (Default)` + +Attribute values are wrapped in double quotes: + +```html +<img src="https://example.com/example.png" onload="testFunc("test")"> +``` + +##### `1` + +Attribute values are wrapped in single quote: + +```html +<img src='https://example.com/example.png' onload='testFunc("test")'> +``` + +##### `0` + +Quote style is based on attribute values (an alternative for `replaceQuote` option): + +```html +<img src="https://example.com/example.png" onload='testFunc("test")'> +``` + + +[npm]: https://img.shields.io/npm/v/posthtml-render.svg +[npm-url]: https://npmjs.com/package/posthtml-render + +[node]: https://img.shields.io/node/v/posthtml-render.svg +[node-url]: https://img.shields.io/node/v/posthtml-render.svg + +[tests]: http://img.shields.io/travis/posthtml/posthtml-render.svg +[tests-url]: https://travis-ci.org/posthtml/posthtml-render + +[cover]: https://coveralls.io/repos/github/posthtml/posthtml-render/badge.svg +[cover-url]: https://coveralls.io/github/posthtml/posthtml-render |
