diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f31a1c..d60a9d6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,577 +16,494 @@ ## [4.32.4](https://github.com/diplodoc-platform/transform/compare/v4.32.3...v4.32.4) (2024-10-21) - ### Bug Fixes -* add included ignore includes ([#538](https://github.com/diplodoc-platform/transform/issues/538)) ([a3b2d77](https://github.com/diplodoc-platform/transform/commit/a3b2d77487f8653d7683f9672dde33c99a8b43a5)) +- add included ignore includes ([#538](https://github.com/diplodoc-platform/transform/issues/538)) ([a3b2d77](https://github.com/diplodoc-platform/transform/commit/a3b2d77487f8653d7683f9672dde33c99a8b43a5)) ## [4.32.3](https://github.com/diplodoc-platform/transform/compare/v4.32.2...v4.32.3) (2024-10-21) - ### Bug Fixes -* bump tabs plugin v3.5.0 ([aa6f391](https://github.com/diplodoc-platform/transform/commit/aa6f3915dc24ac175a29db2109e4ab667b8b4dff)) +- bump tabs plugin v3.5.0 ([aa6f391](https://github.com/diplodoc-platform/transform/commit/aa6f3915dc24ac175a29db2109e4ab667b8b4dff)) ## [4.32.2](https://github.com/diplodoc-platform/transform/compare/v4.32.1...v4.32.2) (2024-10-01) - ### Bug Fixes -* do an `isArray` check first when transforming front matter values ([7f918f5](https://github.com/diplodoc-platform/transform/commit/7f918f5958128b7db98d294f2ded2dfd6274ad91)) +- do an `isArray` check first when transforming front matter values ([7f918f5](https://github.com/diplodoc-platform/transform/commit/7f918f5958128b7db98d294f2ded2dfd6274ad91)) ## [4.32.1](https://github.com/diplodoc-platform/transform/compare/v4.32.0...v4.32.1) (2024-10-01) - ### Bug Fixes -* replace variables with values ([34ec9a9](https://github.com/diplodoc-platform/transform/commit/34ec9a9602e378955f88982f99891b235c8e98f3)) +- replace variables with values ([34ec9a9](https://github.com/diplodoc-platform/transform/commit/34ec9a9602e378955f88982f99891b235c8e98f3)) ## [4.32.0](https://github.com/diplodoc-platform/transform/compare/v4.31.3...v4.32.0) (2024-09-30) - ### Features -* add css-api ([#515](https://github.com/diplodoc-platform/transform/issues/515)) ([d9b2284](https://github.com/diplodoc-platform/transform/commit/d9b2284d33b79c934746041060560ae177fa1668)) -* **deps:** bump diplodoc/tabs-extension to v3.4.0 ([#522](https://github.com/diplodoc-platform/transform/issues/522)) ([357ad7c](https://github.com/diplodoc-platform/transform/commit/357ad7cae2133d6c1a6fa83f98ab04dd07a7b10c)) -* fump cut plugin ([324d200](https://github.com/diplodoc-platform/transform/commit/324d200d89660bed298d18cce03192b803834392)) -* liquid markdown front matter separately from the rest of the content ([7230d7f](https://github.com/diplodoc-platform/transform/commit/7230d7fe4ef2f4e8186b7c892a54a5d60ca27896)) +- add css-api ([#515](https://github.com/diplodoc-platform/transform/issues/515)) ([d9b2284](https://github.com/diplodoc-platform/transform/commit/d9b2284d33b79c934746041060560ae177fa1668)) +- **deps:** bump diplodoc/tabs-extension to v3.4.0 ([#522](https://github.com/diplodoc-platform/transform/issues/522)) ([357ad7c](https://github.com/diplodoc-platform/transform/commit/357ad7cae2133d6c1a6fa83f98ab04dd07a7b10c)) +- fump cut plugin ([324d200](https://github.com/diplodoc-platform/transform/commit/324d200d89660bed298d18cce03192b803834392)) +- liquid markdown front matter separately from the rest of the content ([7230d7f](https://github.com/diplodoc-platform/transform/commit/7230d7fe4ef2f4e8186b7c892a54a5d60ca27896)) ## [4.31.3](https://github.com/diplodoc-platform/transform/compare/v4.31.2...v4.31.3) (2024-09-20) - ### Bug Fixes -* bump tab plugin ([9775a64](https://github.com/diplodoc-platform/transform/commit/9775a64b703a57ed1694a35b9979196b27ccf6e4)) +- bump tab plugin ([9775a64](https://github.com/diplodoc-platform/transform/commit/9775a64b703a57ed1694a35b9979196b27ccf6e4)) ## [4.31.2](https://github.com/diplodoc-platform/transform/compare/v4.31.1...v4.31.2) (2024-09-17) - ### Bug Fixes -* add useLegacyConditions ([#508](https://github.com/diplodoc-platform/transform/issues/508)) ([56273ef](https://github.com/diplodoc-platform/transform/commit/56273efbc214a7d8eb19043bcd030df26df41efb)) -* Ignore tag style, if sanitize cant parse CSS inside it [#506](https://github.com/diplodoc-platform/transform/issues/506) ([#507](https://github.com/diplodoc-platform/transform/issues/507)) ([182985d](https://github.com/diplodoc-platform/transform/commit/182985d7a2bfe60bc6501db85c0e9040c9dd97e5)) +- add useLegacyConditions ([#508](https://github.com/diplodoc-platform/transform/issues/508)) ([56273ef](https://github.com/diplodoc-platform/transform/commit/56273efbc214a7d8eb19043bcd030df26df41efb)) +- Ignore tag style, if sanitize cant parse CSS inside it [#506](https://github.com/diplodoc-platform/transform/issues/506) ([#507](https://github.com/diplodoc-platform/transform/issues/507)) ([182985d](https://github.com/diplodoc-platform/transform/commit/182985d7a2bfe60bc6501db85c0e9040c9dd97e5)) ## [4.31.1](https://github.com/diplodoc-platform/transform/compare/v4.31.0...v4.31.1) (2024-09-17) - ### Bug Fixes -* add included read file sync ([#509](https://github.com/diplodoc-platform/transform/issues/509)) ([8534be2](https://github.com/diplodoc-platform/transform/commit/8534be2b306046552aa3f8dc931e8edf856da4a6)) +- add included read file sync ([#509](https://github.com/diplodoc-platform/transform/issues/509)) ([8534be2](https://github.com/diplodoc-platform/transform/commit/8534be2b306046552aa3f8dc931e8edf856da4a6)) ## [4.31.0](https://github.com/diplodoc-platform/transform/compare/v4.30.2...v4.31.0) (2024-09-11) - ### Features -* add merge included optimisation ([#504](https://github.com/diplodoc-platform/transform/issues/504)) ([b30899e](https://github.com/diplodoc-platform/transform/commit/b30899e3eb48d0c6e802e319bb64f7ab2e27f88a)) +- add merge included optimisation ([#504](https://github.com/diplodoc-platform/transform/issues/504)) ([b30899e](https://github.com/diplodoc-platform/transform/commit/b30899e3eb48d0c6e802e319bb64f7ab2e27f88a)) ## [4.30.2](https://github.com/diplodoc-platform/transform/compare/v4.30.1...v4.30.2) (2024-09-06) - ### Bug Fixes -* update @diplodoc/tabs-extension ([6b270c3](https://github.com/diplodoc-platform/transform/commit/6b270c3e687c8b44052f05370529a8c22f835a31)) +- update @diplodoc/tabs-extension ([6b270c3](https://github.com/diplodoc-platform/transform/commit/6b270c3e687c8b44052f05370529a8c22f835a31)) ## [4.30.1](https://github.com/diplodoc-platform/transform/compare/v4.30.0...v4.30.1) (2024-09-05) - ### Bug Fixes -* Fix link to build script ([4b5ce79](https://github.com/diplodoc-platform/transform/commit/4b5ce79f77ad9639197be44ab4b4f69c0fbd45e9)) +- Fix link to build script ([4b5ce79](https://github.com/diplodoc-platform/transform/commit/4b5ce79f77ad9639197be44ab4b4f69c0fbd45e9)) ## [4.30.0](https://github.com/diplodoc-platform/transform/compare/v4.29.0...v4.30.0) (2024-09-05) - ### Features -* add merge included ([#485](https://github.com/diplodoc-platform/transform/issues/485)) ([0cf1e0e](https://github.com/diplodoc-platform/transform/commit/0cf1e0efb88a0b53fd1871b119208dff77cdf185)) -* add yandex video, vk video iframes ([6a5033a](https://github.com/diplodoc-platform/transform/commit/6a5033aa88256d70b3615c0f07ec637f3ea2e3ed)) - +- add merge included ([#485](https://github.com/diplodoc-platform/transform/issues/485)) ([0cf1e0e](https://github.com/diplodoc-platform/transform/commit/0cf1e0efb88a0b53fd1871b119208dff77cdf185)) +- add yandex video, vk video iframes ([6a5033a](https://github.com/diplodoc-platform/transform/commit/6a5033aa88256d70b3615c0f07ec637f3ea2e3ed)) ### Bug Fixes -* Trim new video formats names ([b48d452](https://github.com/diplodoc-platform/transform/commit/b48d452abf39531ac85eb8109a1c8e6b0f5ec827)) +- Trim new video formats names ([b48d452](https://github.com/diplodoc-platform/transform/commit/b48d452abf39531ac85eb8109a1c8e6b0f5ec827)) ## [4.29.0](https://github.com/diplodoc-platform/transform/compare/v4.28.3...v4.29.0) (2024-09-05) - ### Features -* add cut plugin ([540e7f0](https://github.com/diplodoc-platform/transform/commit/540e7f0bca98182f724ac2309b5c1c86a5095629)) -* replace cut with an extension from separate package ([9964674](https://github.com/diplodoc-platform/transform/commit/99646747ef591225b88114113a3f6c3c02c7de82)) +- add cut plugin ([540e7f0](https://github.com/diplodoc-platform/transform/commit/540e7f0bca98182f724ac2309b5c1c86a5095629)) +- replace cut with an extension from separate package ([9964674](https://github.com/diplodoc-platform/transform/commit/99646747ef591225b88114113a3f6c3c02c7de82)) ## [4.28.3](https://github.com/diplodoc-platform/transform/compare/v4.28.2...v4.28.3) (2024-09-02) - ### Bug Fixes -* **a11y:** set role button for term ([0467211](https://github.com/diplodoc-platform/transform/commit/0467211a8e8e6180218071288921236bc33531c3)) -* Add data-no-index attribute to anchors ([b9be4a2](https://github.com/diplodoc-platform/transform/commit/b9be4a23d5822f04e30057376ef7d8810833f0ca)) +- **a11y:** set role button for term ([0467211](https://github.com/diplodoc-platform/transform/commit/0467211a8e8e6180218071288921236bc33531c3)) +- Add data-no-index attribute to anchors ([b9be4a2](https://github.com/diplodoc-platform/transform/commit/b9be4a23d5822f04e30057376ef7d8810833f0ca)) ## [4.28.2](https://github.com/diplodoc-platform/transform/compare/v4.28.1...v4.28.2) (2024-08-21) - ### Bug Fixes -* clipboard aria-label & term role ([#490](https://github.com/diplodoc-platform/transform/issues/490)) ([abc298f](https://github.com/diplodoc-platform/transform/commit/abc298f78886b0444e892a4cb2c882f52ae3a115)) +- clipboard aria-label & term role ([#490](https://github.com/diplodoc-platform/transform/issues/490)) ([abc298f](https://github.com/diplodoc-platform/transform/commit/abc298f78886b0444e892a4cb2c882f52ae3a115)) ## [4.28.1](https://github.com/diplodoc-platform/transform/compare/v4.28.0...v4.28.1) (2024-08-20) - ### Bug Fixes -* clipboard opacity on hover ([#488](https://github.com/diplodoc-platform/transform/issues/488)) ([91c6fc8](https://github.com/diplodoc-platform/transform/commit/91c6fc80354053b2ed4a86a8f3de436aa5cd05e0)) +- clipboard opacity on hover ([#488](https://github.com/diplodoc-platform/transform/issues/488)) ([91c6fc8](https://github.com/diplodoc-platform/transform/commit/91c6fc80354053b2ed4a86a8f3de436aa5cd05e0)) ## [4.28.0](https://github.com/diplodoc-platform/transform/compare/v4.27.0...v4.28.0) (2024-08-20) - ### Features -* add autotitle cache context ([#483](https://github.com/diplodoc-platform/transform/issues/483)) ([3ce51f7](https://github.com/diplodoc-platform/transform/commit/3ce51f7bf71786f5617b97eeaf0e7c4df615e952)) -* bump tabs plugin ([18e49aa](https://github.com/diplodoc-platform/transform/commit/18e49aa98679fa6a677d76e7285fc13f08319011)) -* improve focus behavior on terms, anchors, clipboard button ([#486](https://github.com/diplodoc-platform/transform/issues/486)) ([4323b50](https://github.com/diplodoc-platform/transform/commit/4323b5039de79d8e93c4cd06c7a18c00b589fb1f)) +- add autotitle cache context ([#483](https://github.com/diplodoc-platform/transform/issues/483)) ([3ce51f7](https://github.com/diplodoc-platform/transform/commit/3ce51f7bf71786f5617b97eeaf0e7c4df615e952)) +- bump tabs plugin ([18e49aa](https://github.com/diplodoc-platform/transform/commit/18e49aa98679fa6a677d76e7285fc13f08319011)) +- improve focus behavior on terms, anchors, clipboard button ([#486](https://github.com/diplodoc-platform/transform/issues/486)) ([4323b50](https://github.com/diplodoc-platform/transform/commit/4323b5039de79d8e93c4cd06c7a18c00b589fb1f)) ## [4.27.0](https://github.com/diplodoc-platform/transform/compare/v4.26.0...v4.27.0) (2024-08-15) - ### Features -* update @diplodoc/tabs-extension package to v3.2.0 ([#482](https://github.com/diplodoc-platform/transform/issues/482)) ([86d77a7](https://github.com/diplodoc-platform/transform/commit/86d77a718aa4a0ff7966533128c7197d6d0bf66e)) - +- update @diplodoc/tabs-extension package to v3.2.0 ([#482](https://github.com/diplodoc-platform/transform/issues/482)) ([86d77a7](https://github.com/diplodoc-platform/transform/commit/86d77a718aa4a0ff7966533128c7197d6d0bf66e)) ### Bug Fixes -* Fix inline rendering beheavior ([60bdf22](https://github.com/diplodoc-platform/transform/commit/60bdf22c69795d75fd81a15ca4934d5e617c4ed4)) +- Fix inline rendering beheavior ([60bdf22](https://github.com/diplodoc-platform/transform/commit/60bdf22c69795d75fd81a15ca4934d5e617c4ed4)) ## [4.26.0](https://github.com/diplodoc-platform/transform/compare/v4.25.1...v4.26.0) (2024-08-06) - ### Features -* Add transformInline method ([b8db80a](https://github.com/diplodoc-platform/transform/commit/b8db80a11ff1f6ebb013e0c062a02560bc986d1e)), closes [#393](https://github.com/diplodoc-platform/transform/issues/393) -* use <details> tag for cuts ([#476](https://github.com/diplodoc-platform/transform/issues/476)) ([dca71bb](https://github.com/diplodoc-platform/transform/commit/dca71bb11c133f76d481a7abf6e01ce98e5e8cbe)) +- Add transformInline method ([b8db80a](https://github.com/diplodoc-platform/transform/commit/b8db80a11ff1f6ebb013e0c062a02560bc986d1e)), closes [#393](https://github.com/diplodoc-platform/transform/issues/393) +- use <details> tag for cuts ([#476](https://github.com/diplodoc-platform/transform/issues/476)) ([dca71bb](https://github.com/diplodoc-platform/transform/commit/dca71bb11c133f76d481a7abf6e01ce98e5e8cbe)) ## [4.25.1](https://github.com/diplodoc-platform/transform/compare/v4.25.0...v4.25.1) (2024-07-31) - ### Bug Fixes -* Fix liquid conditions corner cases ([079a5cd](https://github.com/diplodoc-platform/transform/commit/079a5cdab2dd8d422bd2c64d32e66c5a95af4547)) +- Fix liquid conditions corner cases ([079a5cd](https://github.com/diplodoc-platform/transform/commit/079a5cdab2dd8d422bd2c64d32e66c5a95af4547)) ## [4.25.0](https://github.com/diplodoc-platform/transform/compare/v4.24.0...v4.25.0) (2024-07-30) - ### Features -* add aria-live for term popup ([#470](https://github.com/diplodoc-platform/transform/issues/470)) ([7fafa30](https://github.com/diplodoc-platform/transform/commit/7fafa30433d15eb3ab1f5bc56972a3a0da9f1683)) - +- add aria-live for term popup ([#470](https://github.com/diplodoc-platform/transform/issues/470)) ([7fafa30](https://github.com/diplodoc-platform/transform/commit/7fafa30433d15eb3ab1f5bc56972a3a0da9f1683)) ### Bug Fixes -* unfoldIncludes should handle errors without path field ([#472](https://github.com/diplodoc-platform/transform/issues/472)) ([501c77b](https://github.com/diplodoc-platform/transform/commit/501c77bf3d2666a3adb6c7b3818fbfc1f0f3fd58)) +- unfoldIncludes should handle errors without path field ([#472](https://github.com/diplodoc-platform/transform/issues/472)) ([501c77b](https://github.com/diplodoc-platform/transform/commit/501c77bf3d2666a3adb6c7b3818fbfc1f0f3fd58)) ## [4.24.0](https://github.com/diplodoc-platform/transform/compare/v4.23.0...v4.24.0) (2024-07-23) - ### Features -* add wide modal in trasform ([3a8ea7c](https://github.com/diplodoc-platform/transform/commit/3a8ea7cb8fd774bc9d959e721646d103777411ab)) +- add wide modal in trasform ([3a8ea7c](https://github.com/diplodoc-platform/transform/commit/3a8ea7cb8fd774bc9d959e721646d103777411ab)) ## [4.23.0](https://github.com/diplodoc-platform/transform/compare/v4.22.0...v4.23.0) (2024-07-22) - ### Features -* add wide modal in trasform ([783d621](https://github.com/diplodoc-platform/transform/commit/783d6211a733eb4049110beb817726fd56faf45b)) +- add wide modal in trasform ([783d621](https://github.com/diplodoc-platform/transform/commit/783d6211a733eb4049110beb817726fd56faf45b)) ## [4.22.0](https://github.com/diplodoc-platform/transform/compare/v4.21.0...v4.22.0) (2024-07-19) - ### Features -* refactor custom attrs ([971d02a](https://github.com/diplodoc-platform/transform/commit/971d02ab2e096fa08d91b6494ce59f78bd108eee)) +- refactor custom attrs ([971d02a](https://github.com/diplodoc-platform/transform/commit/971d02ab2e096fa08d91b6494ce59f78bd108eee)) ## [4.21.0](https://github.com/diplodoc-platform/transform/compare/v4.20.0...v4.21.0) (2024-07-15) - ### Features -* add custom attrs ([1c3bc13](https://github.com/diplodoc-platform/transform/commit/1c3bc13bb499ff4d79b961b0d08c927afda46c44)) -* escape question mark from anchor ([#460](https://github.com/diplodoc-platform/transform/issues/460)) ([5f35b15](https://github.com/diplodoc-platform/transform/commit/5f35b15bd572313c7bbec0aca15d5840fec9c97d)) - +- add custom attrs ([1c3bc13](https://github.com/diplodoc-platform/transform/commit/1c3bc13bb499ff4d79b961b0d08c927afda46c44)) +- escape question mark from anchor ([#460](https://github.com/diplodoc-platform/transform/issues/460)) ([5f35b15](https://github.com/diplodoc-platform/transform/commit/5f35b15bd572313c7bbec0aca15d5840fec9c97d)) ### Bug Fixes -* pop-up definition overlaps header ([#457](https://github.com/diplodoc-platform/transform/issues/457)) ([d0a7c66](https://github.com/diplodoc-platform/transform/commit/d0a7c66e35050051ec444e8b3b1a39e74f2182fb)) +- pop-up definition overlaps header ([#457](https://github.com/diplodoc-platform/transform/issues/457)) ([d0a7c66](https://github.com/diplodoc-platform/transform/commit/d0a7c66e35050051ec444e8b3b1a39e74f2182fb)) ## [4.20.0](https://github.com/diplodoc-platform/transform/compare/v4.19.1...v4.20.0) (2024-07-02) - ### Features -* bump tabs plugin version ([ad296b5](https://github.com/diplodoc-platform/transform/commit/ad296b504e492dff2708de53f3320b66b5a24fb0)) - +- bump tabs plugin version ([ad296b5](https://github.com/diplodoc-platform/transform/commit/ad296b504e492dff2708de53f3320b66b5a24fb0)) ### Bug Fixes -* terms extend beyond right edge of screen ([#447](https://github.com/diplodoc-platform/transform/issues/447)) ([04afecf](https://github.com/diplodoc-platform/transform/commit/04afecff52598053da7379bca2690a5be0e32042)) +- terms extend beyond right edge of screen ([#447](https://github.com/diplodoc-platform/transform/issues/447)) ([04afecf](https://github.com/diplodoc-platform/transform/commit/04afecff52598053da7379bca2690a5be0e32042)) ## [4.19.1](https://github.com/diplodoc-platform/transform/compare/v4.19.0...v4.19.1) (2024-06-17) - ### Bug Fixes -* **table:** make the parsing of cell class stricter ([#444](https://github.com/diplodoc-platform/transform/issues/444)) ([8932d81](https://github.com/diplodoc-platform/transform/commit/8932d81aa99a681be7fc44ff50f3800b4e11afbf)) +- **table:** make the parsing of cell class stricter ([#444](https://github.com/diplodoc-platform/transform/issues/444)) ([8932d81](https://github.com/diplodoc-platform/transform/commit/8932d81aa99a681be7fc44ff50f3800b4e11afbf)) ## [4.19.0](https://github.com/diplodoc-platform/transform/compare/v4.18.0...v4.19.0) (2024-06-11) - ### Features -* bump tabs version ([54bf7d7](https://github.com/diplodoc-platform/transform/commit/54bf7d713175cdacd90d1f3f8a124ceea23e368a)) -* **checkbox:** add disabled option to prevent disabled attribute from being set for checkboxes ([30272fe](https://github.com/diplodoc-platform/transform/commit/30272fef031a710efcafc1fcf9516886203da26d)) -* **table:** add support for row/col spans in multiline tables ([cafabdf](https://github.com/diplodoc-platform/transform/commit/cafabdf4c6f3e370bc85921693a2b3cbf3dcd467)) - +- bump tabs version ([54bf7d7](https://github.com/diplodoc-platform/transform/commit/54bf7d713175cdacd90d1f3f8a124ceea23e368a)) +- **checkbox:** add disabled option to prevent disabled attribute from being set for checkboxes ([30272fe](https://github.com/diplodoc-platform/transform/commit/30272fef031a710efcafc1fcf9516886203da26d)) +- **table:** add support for row/col spans in multiline tables ([cafabdf](https://github.com/diplodoc-platform/transform/commit/cafabdf4c6f3e370bc85921693a2b3cbf3dcd467)) ### Bug Fixes -* Fix liquid conditions ([39d6be1](https://github.com/diplodoc-platform/transform/commit/39d6be1aff7eca4688efeff345dd3885978ba331)) +- Fix liquid conditions ([39d6be1](https://github.com/diplodoc-platform/transform/commit/39d6be1aff7eca4688efeff345dd3885978ba331)) ## [4.18.0](https://github.com/diplodoc-platform/transform/compare/v4.17.2...v4.18.0) (2024-06-05) - ### Features -* add print styles for term plugin ([3c1576a](https://github.com/diplodoc-platform/transform/commit/3c1576ac57ae6cbf1f68fc65f7dc911b49e54b38)) -* display all tabs sequentially ([fb5e241](https://github.com/diplodoc-platform/transform/commit/fb5e241c4e283ba0c957b73889b7ffdc80a9da22)) -* liquid returns result with type as type of variable ([f5af53c](https://github.com/diplodoc-platform/transform/commit/f5af53c689a593e46108a2d898e9eb7da2583c63)) - +- add print styles for term plugin ([3c1576a](https://github.com/diplodoc-platform/transform/commit/3c1576ac57ae6cbf1f68fc65f7dc911b49e54b38)) +- display all tabs sequentially ([fb5e241](https://github.com/diplodoc-platform/transform/commit/fb5e241c4e283ba0c957b73889b7ffdc80a9da22)) +- liquid returns result with type as type of variable ([f5af53c](https://github.com/diplodoc-platform/transform/commit/f5af53c689a593e46108a2d898e9eb7da2583c63)) ### Bug Fixes -* display content of cut block in print mode ([73ffb2a](https://github.com/diplodoc-platform/transform/commit/73ffb2ae89768129a64972a83e5c2adf18cc8c7b)) -* make anchor opacity 0 and 1 instead of changing visibility ([#432](https://github.com/diplodoc-platform/transform/issues/432)) ([d081bbe](https://github.com/diplodoc-platform/transform/commit/d081bbe82601610135555d476f03b29ec09a171d)) +- display content of cut block in print mode ([73ffb2a](https://github.com/diplodoc-platform/transform/commit/73ffb2ae89768129a64972a83e5c2adf18cc8c7b)) +- make anchor opacity 0 and 1 instead of changing visibility ([#432](https://github.com/diplodoc-platform/transform/issues/432)) ([d081bbe](https://github.com/diplodoc-platform/transform/commit/d081bbe82601610135555d476f03b29ec09a171d)) ## [4.17.2](https://github.com/diplodoc-platform/transform/compare/v4.17.1...v4.17.2) (2024-05-29) - ### Bug Fixes -* Fix liquid conditions ([3f7603d](https://github.com/diplodoc-platform/transform/commit/3f7603dd099e0466ff29078f935dfbea3e5f9407)) +- Fix liquid conditions ([3f7603d](https://github.com/diplodoc-platform/transform/commit/3f7603dd099e0466ff29078f935dfbea3e5f9407)) ## [4.17.1](https://github.com/diplodoc-platform/transform/compare/v4.17.0...v4.17.1) (2024-05-28) - ### Bug Fixes -* Fix liquid conditions processing ([8a3628c](https://github.com/diplodoc-platform/transform/commit/8a3628c916a687f4a2f17928c786911be734cb42)) +- Fix liquid conditions processing ([8a3628c](https://github.com/diplodoc-platform/transform/commit/8a3628c916a687f4a2f17928c786911be734cb42)) ## [4.17.0](https://github.com/diplodoc-platform/transform/compare/v4.16.1...v4.17.0) (2024-05-17) - ### Features -* **cut:** add-margin-bottom-cut ([6d42230](https://github.com/diplodoc-platform/transform/commit/6d422307d6fb2e7eb5104d933aec3dd70e1f366b)) - +- **cut:** add-margin-bottom-cut ([6d42230](https://github.com/diplodoc-platform/transform/commit/6d422307d6fb2e7eb5104d933aec3dd70e1f366b)) ### Bug Fixes -* Fix liquid conditions inside notes ([668c1d4](https://github.com/diplodoc-platform/transform/commit/668c1d43f8d196776cf0baca1b49872f557d6a72)) +- Fix liquid conditions inside notes ([668c1d4](https://github.com/diplodoc-platform/transform/commit/668c1d43f8d196776cf0baca1b49872f557d6a72)) ## [4.16.1](https://github.com/diplodoc-platform/transform/compare/v4.16.0...v4.16.1) (2024-05-17) - ### Bug Fixes -* set href to anchor to empty for non getPublicPath builds ([#419](https://github.com/diplodoc-platform/transform/issues/419)) ([60469e2](https://github.com/diplodoc-platform/transform/commit/60469e237b3e7ed01ad7d52f93e42616fdd67a3b)) +- set href to anchor to empty for non getPublicPath builds ([#419](https://github.com/diplodoc-platform/transform/issues/419)) ([60469e2](https://github.com/diplodoc-platform/transform/commit/60469e237b3e7ed01ad7d52f93e42616fdd67a3b)) ## [4.16.0](https://github.com/diplodoc-platform/transform/compare/v4.15.0...v4.16.0) (2024-05-16) - ### Features -* Support options conditions `strict` value ([d11e6c0](https://github.com/diplodoc-platform/transform/commit/d11e6c00166119afe9da273dd1b60a550c355a4e)) - +- Support options conditions `strict` value ([d11e6c0](https://github.com/diplodoc-platform/transform/commit/d11e6c00166119afe9da273dd1b60a550c355a4e)) ### Bug Fixes -* change isAbsolute to includes double slashes ([#418](https://github.com/diplodoc-platform/transform/issues/418)) ([da4c652](https://github.com/diplodoc-platform/transform/commit/da4c652803d4ca5106076124c58755167152c312)) +- change isAbsolute to includes double slashes ([#418](https://github.com/diplodoc-platform/transform/issues/418)) ([da4c652](https://github.com/diplodoc-platform/transform/commit/da4c652803d4ca5106076124c58755167152c312)) ## [4.15.0](https://github.com/diplodoc-platform/transform/compare/v4.14.2...v4.15.0) (2024-05-08) - ### Features -* add default public path ([#414](https://github.com/diplodoc-platform/transform/issues/414)) ([622c7c8](https://github.com/diplodoc-platform/transform/commit/622c7c85030881518b601beabec7b088291eab1b)) +- add default public path ([#414](https://github.com/diplodoc-platform/transform/issues/414)) ([622c7c8](https://github.com/diplodoc-platform/transform/commit/622c7c85030881518b601beabec7b088291eab1b)) ## [4.14.2](https://github.com/diplodoc-platform/transform/compare/v4.14.1...v4.14.2) (2024-05-07) - ### Bug Fixes -* disable by default new markdownlint rules ([ebb5291](https://github.com/diplodoc-platform/transform/commit/ebb5291acadbb0098438602b80e0f6d97a923309)) +- disable by default new markdownlint rules ([ebb5291](https://github.com/diplodoc-platform/transform/commit/ebb5291acadbb0098438602b80e0f6d97a923309)) ## [4.14.1](https://github.com/diplodoc-platform/transform/compare/v4.14.0...v4.14.1) (2024-05-03) - ### Bug Fixes -* handling of multiple block anchors in transform ([ff507ba](https://github.com/diplodoc-platform/transform/commit/ff507ba3a6e642b1097c376a58414db44195acf6)) +- handling of multiple block anchors in transform ([ff507ba](https://github.com/diplodoc-platform/transform/commit/ff507ba3a6e642b1097c376a58414db44195acf6)) ## [4.14.0](https://github.com/diplodoc-platform/transform/compare/v4.13.1...v4.14.0) (2024-05-02) - ### Features -* add relative path resolution for links ([#407](https://github.com/diplodoc-platform/transform/issues/407)) ([ee159f4](https://github.com/diplodoc-platform/transform/commit/ee159f4e91e468d70a144c0c08b580e00eb48505)) +- add relative path resolution for links ([#407](https://github.com/diplodoc-platform/transform/issues/407)) ([ee159f4](https://github.com/diplodoc-platform/transform/commit/ee159f4e91e468d70a144c0c08b580e00eb48505)) ## [4.13.1](https://github.com/diplodoc-platform/transform/compare/v4.13.0...v4.13.1) (2024-04-09) - ### Bug Fixes -* add dirname to config ([3d838be](https://github.com/diplodoc-platform/transform/commit/3d838be8a6d7adb04c512eae12a59aac1052b61b)) +- add dirname to config ([3d838be](https://github.com/diplodoc-platform/transform/commit/3d838be8a6d7adb04c512eae12a59aac1052b61b)) ## [4.13.0](https://github.com/diplodoc-platform/transform/compare/v4.12.0...v4.13.0) (2024-04-09) - ### Features -* add svgo ([963782b](https://github.com/diplodoc-platform/transform/commit/963782b6f01ef8fbe75f30b6911ea2de4f4f15a0)) +- add svgo ([963782b](https://github.com/diplodoc-platform/transform/commit/963782b6f01ef8fbe75f30b6911ea2de4f4f15a0)) ## [4.12.0](https://github.com/diplodoc-platform/transform/compare/v4.11.0...v4.12.0) (2024-04-05) - ### Features -* add tr-TR, kk-KZ, uz-UZ, bg-BG, zh-TW, zh-CN, pt-PT, et-EE, el-GR langs ([#396](https://github.com/diplodoc-platform/transform/issues/396)) ([c3c5a42](https://github.com/diplodoc-platform/transform/commit/c3c5a42f0ddece2ca29ab54ef9b4eab62257ab57)) +- add tr-TR, kk-KZ, uz-UZ, bg-BG, zh-TW, zh-CN, pt-PT, et-EE, el-GR langs ([#396](https://github.com/diplodoc-platform/transform/issues/396)) ([c3c5a42](https://github.com/diplodoc-platform/transform/commit/c3c5a42f0ddece2ca29ab54ef9b4eab62257ab57)) ## [4.11.0](https://github.com/diplodoc-platform/transform/compare/v4.10.8...v4.11.0) (2024-03-11) - ### Features -* update tabs extension to 2.1.0 ([#390](https://github.com/diplodoc-platform/transform/issues/390)) ([cd07183](https://github.com/diplodoc-platform/transform/commit/cd07183797b3c587e56f00372e648ca6a597d920)) +- update tabs extension to 2.1.0 ([#390](https://github.com/diplodoc-platform/transform/issues/390)) ([cd07183](https://github.com/diplodoc-platform/transform/commit/cd07183797b3c587e56f00372e648ca6a597d920)) ## [4.10.8](https://github.com/diplodoc-platform/transform/compare/v4.10.7...v4.10.8) (2024-03-05) - ### Bug Fixes -* **anchors:** use entire heading text for auto named anchors ([#384](https://github.com/diplodoc-platform/transform/issues/384)) ([e3c725b](https://github.com/diplodoc-platform/transform/commit/e3c725b93fe2c6517cf5ac210a1cb6c7e65281a3)) +- **anchors:** use entire heading text for auto named anchors ([#384](https://github.com/diplodoc-platform/transform/issues/384)) ([e3c725b](https://github.com/diplodoc-platform/transform/commit/e3c725b93fe2c6517cf5ac210a1cb6c7e65281a3)) ## [4.10.7](https://github.com/diplodoc-platform/transform/compare/v4.10.6...v4.10.7) (2024-03-04) - ### Bug Fixes -* anchors in tabs ([ab7d5b1](https://github.com/diplodoc-platform/transform/commit/ab7d5b1647ca80b528e0a0569389d401ba9d7bab)) +- anchors in tabs ([ab7d5b1](https://github.com/diplodoc-platform/transform/commit/ab7d5b1647ca80b528e0a0569389d401ba9d7bab)) ## [4.10.6](https://github.com/diplodoc-platform/transform/compare/v4.10.5...v4.10.6) (2024-02-29) - ### Bug Fixes -* update tabs-extension ([#380](https://github.com/diplodoc-platform/transform/issues/380)) ([57ccae9](https://github.com/diplodoc-platform/transform/commit/57ccae9f23c91a169f7bcef851d3a465ac4cae43)) +- update tabs-extension ([#380](https://github.com/diplodoc-platform/transform/issues/380)) ([57ccae9](https://github.com/diplodoc-platform/transform/commit/57ccae9f23c91a169f7bcef851d3a465ac4cae43)) ## [4.10.5](https://github.com/diplodoc-platform/transform/compare/v4.10.4...v4.10.5) (2024-02-28) - ### Bug Fixes -* **styles:** remove margin only on first or last element in table cell ([#377](https://github.com/diplodoc-platform/transform/issues/377)) ([f4bd5fe](https://github.com/diplodoc-platform/transform/commit/f4bd5fe468de57038a78fe6ed8942096967b4c8e)) -* **styles:** set vertical-align:top for table cells ([#379](https://github.com/diplodoc-platform/transform/issues/379)) ([0db5b84](https://github.com/diplodoc-platform/transform/commit/0db5b84f4ecc01b2ad7d9d1e953d943b53ef360c)) +- **styles:** remove margin only on first or last element in table cell ([#377](https://github.com/diplodoc-platform/transform/issues/377)) ([f4bd5fe](https://github.com/diplodoc-platform/transform/commit/f4bd5fe468de57038a78fe6ed8942096967b4c8e)) +- **styles:** set vertical-align:top for table cells ([#379](https://github.com/diplodoc-platform/transform/issues/379)) ([0db5b84](https://github.com/diplodoc-platform/transform/commit/0db5b84f4ecc01b2ad7d9d1e953d943b53ef360c)) ## [4.10.4](https://github.com/diplodoc-platform/transform/compare/v4.10.3...v4.10.4) (2024-02-14) - ### Bug Fixes -* absolute anchors ([30f943b](https://github.com/diplodoc-platform/transform/commit/30f943be1730d995c5782b2ab6f7c35bccff0cbf)) +- absolute anchors ([30f943b](https://github.com/diplodoc-platform/transform/commit/30f943be1730d995c5782b2ab6f7c35bccff0cbf)) ## [4.10.3](https://github.com/diplodoc-platform/transform/compare/v4.10.2...v4.10.3) (2024-02-08) - ### Bug Fixes -* Update tabs extension ([f497672](https://github.com/diplodoc-platform/transform/commit/f4976726e229b55d6e0948e9a386f55b173c9e93)) +- Update tabs extension ([f497672](https://github.com/diplodoc-platform/transform/commit/f4976726e229b55d6e0948e9a386f55b173c9e93)) ## [4.10.2](https://github.com/diplodoc-platform/transform/compare/v4.10.1...v4.10.2) (2024-02-07) - ### Bug Fixes -* Update tabs extension ([a38f3d2](https://github.com/diplodoc-platform/transform/commit/a38f3d23395a8bd9cf9046158142a05419b84506)) +- Update tabs extension ([a38f3d2](https://github.com/diplodoc-platform/transform/commit/a38f3d23395a8bd9cf9046158142a05419b84506)) ## [4.10.1](https://github.com/diplodoc-platform/transform/compare/v4.10.0...v4.10.1) (2024-02-07) - ### Bug Fixes -* ol in cut after ol ([3d691da](https://github.com/diplodoc-platform/transform/commit/3d691dac00b09eecddcbd149fc4c90af228f62ab)) +- ol in cut after ol ([3d691da](https://github.com/diplodoc-platform/transform/commit/3d691dac00b09eecddcbd149fc4c90af228f62ab)) ## [4.10.0](https://github.com/diplodoc-platform/transform/compare/v4.9.0...v4.10.0) (2024-02-01) - ### Features -* **note:** support he-IL, es-ES, fr-FR, cs-CZ, ar-SA langs ([#365](https://github.com/diplodoc-platform/transform/issues/365)) ([a925e1b](https://github.com/diplodoc-platform/transform/commit/a925e1b1931b2625475f2af12e10af54143b15d4)) +- **note:** support he-IL, es-ES, fr-FR, cs-CZ, ar-SA langs ([#365](https://github.com/diplodoc-platform/transform/issues/365)) ([a925e1b](https://github.com/diplodoc-platform/transform/commit/a925e1b1931b2625475f2af12e10af54143b15d4)) ## [4.9.0](https://github.com/diplodoc-platform/transform/compare/v4.8.2...v4.9.0) (2024-02-01) - ### Features -* Add notesAutotitle prop ([9a89834](https://github.com/diplodoc-platform/transform/commit/9a898346a9aba8a04ca37a41de56f37db7809322)) - +- Add notesAutotitle prop ([9a89834](https://github.com/diplodoc-platform/transform/commit/9a898346a9aba8a04ca37a41de56f37db7809322)) ### Bug Fixes -* add `object-fit: contain` for images ([9ee96c7](https://github.com/diplodoc-platform/transform/commit/9ee96c71c851de8ea6e2ec4b857f86ec92a61a89)) +- add `object-fit: contain` for images ([9ee96c7](https://github.com/diplodoc-platform/transform/commit/9ee96c71c851de8ea6e2ec4b857f86ec92a61a89)) ## [4.8.2](https://github.com/diplodoc-platform/transform/compare/v4.8.1...v4.8.2) (2024-01-18) - ### Bug Fixes -* **Changelogs:** storyId as string, fix parse last line ([#361](https://github.com/diplodoc-platform/transform/issues/361)) ([e4aa941](https://github.com/diplodoc-platform/transform/commit/e4aa941357e41232a7a0c8beb96632a50b258823)) +- **Changelogs:** storyId as string, fix parse last line ([#361](https://github.com/diplodoc-platform/transform/issues/361)) ([e4aa941](https://github.com/diplodoc-platform/transform/commit/e4aa941357e41232a7a0c8beb96632a50b258823)) ## [4.8.1](https://github.com/diplodoc-platform/transform/compare/v4.8.0...v4.8.1) (2023-12-27) - ### Bug Fixes -* revert pr338 && add cut w/ code test ([#358](https://github.com/diplodoc-platform/transform/issues/358)) ([b5449c2](https://github.com/diplodoc-platform/transform/commit/b5449c2f6e8c402cee98b7690a090bf2ade3985a)) +- revert pr338 && add cut w/ code test ([#358](https://github.com/diplodoc-platform/transform/issues/358)) ([b5449c2](https://github.com/diplodoc-platform/transform/commit/b5449c2f6e8c402cee98b7690a090bf2ade3985a)) ## [4.8.0](https://github.com/diplodoc-platform/transform/compare/v4.7.3...v4.8.0) (2023-12-22) - ### Features -* **plugins/terms:** rtl support ([#354](https://github.com/diplodoc-platform/transform/issues/354)) ([d2964aa](https://github.com/diplodoc-platform/transform/commit/d2964aa008d3675250fd4602008133650b54614a)) +- **plugins/terms:** rtl support ([#354](https://github.com/diplodoc-platform/transform/issues/354)) ([d2964aa](https://github.com/diplodoc-platform/transform/commit/d2964aa008d3675250fd4602008133650b54614a)) ## [4.7.3](https://github.com/diplodoc-platform/transform/compare/v4.7.2...v4.7.3) (2023-12-18) - ### Bug Fixes -* Update markdown-it ([24e817d](https://github.com/diplodoc-platform/transform/commit/24e817d7130df6992cd5770dacf86ad612bc35d5)) -* Update markdownit ([d314ef5](https://github.com/diplodoc-platform/transform/commit/d314ef5ccdbe62ecb3725030dd2fed30cd525109)) +- Update markdown-it ([24e817d](https://github.com/diplodoc-platform/transform/commit/24e817d7130df6992cd5770dacf86ad612bc35d5)) +- Update markdownit ([d314ef5](https://github.com/diplodoc-platform/transform/commit/d314ef5ccdbe62ecb3725030dd2fed30cd525109)) ## [4.7.2](https://github.com/diplodoc-platform/transform/compare/v4.7.1...v4.7.2) (2023-12-14) - ### Bug Fixes -* block anchors export ([c331ea5](https://github.com/diplodoc-platform/transform/commit/c331ea5911c8453a98dc9c6b423b4e2f1bb96411)) -* Update tabs extension ([c038799](https://github.com/diplodoc-platform/transform/commit/c0387998ca4bf4b1ee86bc140b6d4bfd5c360125)) +- block anchors export ([c331ea5](https://github.com/diplodoc-platform/transform/commit/c331ea5911c8453a98dc9c6b423b4e2f1bb96411)) +- Update tabs extension ([c038799](https://github.com/diplodoc-platform/transform/commit/c0387998ca4bf4b1ee86bc140b6d4bfd5c360125)) ## [4.7.1](https://github.com/diplodoc-platform/transform/compare/v4.7.0...v4.7.1) (2023-12-12) - ### Bug Fixes -* cut plugin && add tests ([#338](https://github.com/diplodoc-platform/transform/issues/338)) ([ac31450](https://github.com/diplodoc-platform/transform/commit/ac3145030e12a7d6bd442015f6b23ab61c3d148e)) -* **plugins/notes:** add map to yfm_note_close token ([ab04389](https://github.com/diplodoc-platform/transform/commit/ab04389e8c1d02bdbecf194c59abd8e516489f6d)) +- cut plugin && add tests ([#338](https://github.com/diplodoc-platform/transform/issues/338)) ([ac31450](https://github.com/diplodoc-platform/transform/commit/ac3145030e12a7d6bd442015f6b23ab61c3d148e)) +- **plugins/notes:** add map to yfm_note_close token ([ab04389](https://github.com/diplodoc-platform/transform/commit/ab04389e8c1d02bdbecf194c59abd8e516489f6d)) ## [4.7.0](https://github.com/diplodoc-platform/transform/compare/v4.6.0...v4.7.0) (2023-12-11) - ### Features -* add block anchor to default plugins ([f2a526c](https://github.com/diplodoc-platform/transform/commit/f2a526c7950972c7850953145bbcbaa5b11fd665)) - +- add block anchor to default plugins ([f2a526c](https://github.com/diplodoc-platform/transform/commit/f2a526c7950972c7850953145bbcbaa5b11fd665)) ### Bug Fixes -* don't import lodash global object ([#345](https://github.com/diplodoc-platform/transform/issues/345)) ([df59dd6](https://github.com/diplodoc-platform/transform/commit/df59dd62180fd05a4623e5007e2a3fd8c2a51250)) +- don't import lodash global object ([#345](https://github.com/diplodoc-platform/transform/issues/345)) ([df59dd6](https://github.com/diplodoc-platform/transform/commit/df59dd62180fd05a4623e5007e2a3fd8c2a51250)) ## [4.6.0](https://github.com/diplodoc-platform/transform/compare/v4.5.0...v4.6.0) (2023-12-04) - ### Features -* **ImagesPlugin:** add `inlineSvg` option ([1c802ec](https://github.com/diplodoc-platform/transform/commit/1c802ec43f90783db73b5bf22235d4a8d1ee3de1)) +- **ImagesPlugin:** add `inlineSvg` option ([1c802ec](https://github.com/diplodoc-platform/transform/commit/1c802ec43f90783db73b5bf22235d4a8d1ee3de1)) ## [4.5.0](https://github.com/diplodoc-platform/transform/compare/v4.4.0...v4.5.0) (2023-11-30) - ### Features -* add plugin for detached anchors ([de87eca](https://github.com/diplodoc-platform/transform/commit/de87eca8d364c09160ed0fd64476aaf5c378fd33)) -* match anchors within paragraphs ([19551c2](https://github.com/diplodoc-platform/transform/commit/19551c2ae69048d82b28c703f0cea93f20e9e7fb)) - +- add plugin for detached anchors ([de87eca](https://github.com/diplodoc-platform/transform/commit/de87eca8d364c09160ed0fd64476aaf5c378fd33)) +- match anchors within paragraphs ([19551c2](https://github.com/diplodoc-platform/transform/commit/19551c2ae69048d82b28c703f0cea93f20e9e7fb)) ### Bug Fixes -* simplify match token check ([cb42b3f](https://github.com/diplodoc-platform/transform/commit/cb42b3f9c4cbd14da462b8e6b429b436f073841e)) -* use hr instead of a tag ([0a70e2e](https://github.com/diplodoc-platform/transform/commit/0a70e2ee284c1fbca2efb169be77de8634451506)) +- simplify match token check ([cb42b3f](https://github.com/diplodoc-platform/transform/commit/cb42b3f9c4cbd14da462b8e6b429b436f073841e)) +- use hr instead of a tag ([0a70e2e](https://github.com/diplodoc-platform/transform/commit/0a70e2ee284c1fbca2efb169be77de8634451506)) ## [4.4.0](https://github.com/diplodoc-platform/transform/compare/v4.3.1...v4.4.0) (2023-11-29) - ### Features -* add content node to note ([#329](https://github.com/diplodoc-platform/transform/issues/329)) ([1cabde1](https://github.com/diplodoc-platform/transform/commit/1cabde18fca2b0bda68e10c57a5e4a3cd72fe02f)) - +- add content node to note ([#329](https://github.com/diplodoc-platform/transform/issues/329)) ([1cabde1](https://github.com/diplodoc-platform/transform/commit/1cabde18fca2b0bda68e10c57a5e4a3cd72fe02f)) ### Bug Fixes -* correct nested ol indexing in firefox ([ff29282](https://github.com/diplodoc-platform/transform/commit/ff29282dbc2857bf55c4b8deebffb1a77ab9401b)) +- correct nested ol indexing in firefox ([ff29282](https://github.com/diplodoc-platform/transform/commit/ff29282dbc2857bf55c4b8deebffb1a77ab9401b)) ## [4.3.1](https://github.com/diplodoc-platform/transform/compare/v4.3.0...v4.3.1) (2023-11-23) - ### Bug Fixes -* **plugins/table:** allow liquid variables with filters ([a24228e](https://github.com/diplodoc-platform/transform/commit/a24228ee3410fcbce9f8a25b6f3b102e8304f6b8)) +- **plugins/table:** allow liquid variables with filters ([a24228e](https://github.com/diplodoc-platform/transform/commit/a24228ee3410fcbce9f8a25b6f3b102e8304f6b8)) ## [4.3.0](https://github.com/diplodoc-platform/transform/compare/v4.2.1...v4.3.0) (2023-11-10) - ### Features -* lint ([e3968e9](https://github.com/diplodoc-platform/transform/commit/e3968e91d55c503eed68a2fc7776624cc3d8f331)) - +- lint ([e3968e9](https://github.com/diplodoc-platform/transform/commit/e3968e91d55c503eed68a2fc7776624cc3d8f331)) ### Bug Fixes -* add openapi variable ([a1b0045](https://github.com/diplodoc-platform/transform/commit/a1b004584664511b54fe69ec7c4807703b8b4e77)) +- add openapi variable ([a1b0045](https://github.com/diplodoc-platform/transform/commit/a1b004584664511b54fe69ec7c4807703b8b4e77)) ## [4.2.1](https://github.com/diplodoc-platform/transform/compare/v4.2.0...v4.2.1) (2023-10-20) - ### Bug Fixes -* setting 'display: none' style for closed cut ([#321](https://github.com/diplodoc-platform/transform/issues/321)) ([22831d0](https://github.com/diplodoc-platform/transform/commit/22831d04f9fd092baf42081a5a8b0e7a5962ca6f)) +- setting 'display: none' style for closed cut ([#321](https://github.com/diplodoc-platform/transform/issues/321)) ([22831d0](https://github.com/diplodoc-platform/transform/commit/22831d04f9fd092baf42081a5a8b0e7a5962ca6f)) ## [4.2.0](https://github.com/diplodoc-platform/transform/compare/v4.1.0...v4.2.0) (2023-10-18) - ### Features -* add babel ([af5fbdc](https://github.com/diplodoc-platform/transform/commit/af5fbdc901d69ae9b7f0ab4b941f3fc5bd99866c)) -* added print styles and js for plugins ([4bc6ad7](https://github.com/diplodoc-platform/transform/commit/4bc6ad7dd0e9060e748a8c267dc9793fbb95952f)) -* bump node to 18 ([de1934f](https://github.com/diplodoc-platform/transform/commit/de1934f758659f1700a3d85a6b18cbc1ebdcd752)) - +- add babel ([af5fbdc](https://github.com/diplodoc-platform/transform/commit/af5fbdc901d69ae9b7f0ab4b941f3fc5bd99866c)) +- added print styles and js for plugins ([4bc6ad7](https://github.com/diplodoc-platform/transform/commit/4bc6ad7dd0e9060e748a8c267dc9793fbb95952f)) +- bump node to 18 ([de1934f](https://github.com/diplodoc-platform/transform/commit/de1934f758659f1700a3d85a6b18cbc1ebdcd752)) ### Bug Fixes -* bump node version in action ([80531b7](https://github.com/diplodoc-platform/transform/commit/80531b7ad9cfec4ee2d86c93ca839b24a8da9b66)) +- bump node version in action ([80531b7](https://github.com/diplodoc-platform/transform/commit/80531b7ad9cfec4ee2d86c93ca839b24a8da9b66)) ## [4.1.0](https://github.com/diplodoc-platform/transform/compare/v4.0.0...v4.1.0) (2023-09-29) - ### Features -* update @diplodoc/tabs-extension to 2.0.12 ([48f2fc3](https://github.com/diplodoc-platform/transform/commit/48f2fc319c72066eb99341a454733de4b720b249)) - +- update @diplodoc/tabs-extension to 2.0.12 ([48f2fc3](https://github.com/diplodoc-platform/transform/commit/48f2fc319c72066eb99341a454733de4b720b249)) ## [4.0.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.11.0...v4.0.0) (2023-09-22) - ### ⚠ BREAKING CHANGES + - New term's linter - Enabling `needToSanitizeHtml` by default @@ -594,394 +511,339 @@ ### Features -* @diplodoc/transform@v4 ([92d3501](https://github.com/yandex-cloud/yfm-transform/commit/92d350168d9c7d6707df0473b1b6e614fe19f702)) +- @diplodoc/transform@v4 ([92d3501](https://github.com/yandex-cloud/yfm-transform/commit/92d350168d9c7d6707df0473b1b6e614fe19f702)) ## [3.11.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.10.3...v3.11.0) (2023-09-12) - ### Features -* Update @diplodoc/tabs-extension ([#303](https://github.com/yandex-cloud/yfm-transform/issues/303)) ([5325f83](https://github.com/yandex-cloud/yfm-transform/commit/5325f83f1398a2cbd459e365310c606cce6d6344)) +- Update @diplodoc/tabs-extension ([#303](https://github.com/yandex-cloud/yfm-transform/issues/303)) ([5325f83](https://github.com/yandex-cloud/yfm-transform/commit/5325f83f1398a2cbd459e365310c606cce6d6344)) ## [3.10.3](https://github.com/yandex-cloud/yfm-transform/compare/v3.10.2...v3.10.3) (2023-09-06) - ### Bug Fixes -* call transformLink callback for absolute links ([#301](https://github.com/yandex-cloud/yfm-transform/issues/301)) ([3222f5f](https://github.com/yandex-cloud/yfm-transform/commit/3222f5fb1ac4a9da053ab1d6e05e5c21d31d9445)) +- call transformLink callback for absolute links ([#301](https://github.com/yandex-cloud/yfm-transform/issues/301)) ([3222f5f](https://github.com/yandex-cloud/yfm-transform/commit/3222f5fb1ac4a9da053ab1d6e05e5c21d31d9445)) ## [3.10.2](https://github.com/yandex-cloud/yfm-transform/compare/v3.10.1...v3.10.2) (2023-09-04) - ### Bug Fixes -* absolute links in included files ([cefe20a](https://github.com/yandex-cloud/yfm-transform/commit/cefe20af8a80827929fe36d2e85d5a9b56b3f701)) +- absolute links in included files ([cefe20a](https://github.com/yandex-cloud/yfm-transform/commit/cefe20af8a80827929fe36d2e85d5a9b56b3f701)) ## [3.10.1](https://github.com/yandex-cloud/yfm-transform/compare/v3.10.0...v3.10.1) (2023-09-01) - ### Bug Fixes -* table styles ([#297](https://github.com/yandex-cloud/yfm-transform/issues/297)) ([ea49cf2](https://github.com/yandex-cloud/yfm-transform/commit/ea49cf285616533e4d8be64c6596ee9dc44c84fd)) +- table styles ([#297](https://github.com/yandex-cloud/yfm-transform/issues/297)) ([ea49cf2](https://github.com/yandex-cloud/yfm-transform/commit/ea49cf285616533e4d8be64c6596ee9dc44c84fd)) ## [3.10.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.9.1...v3.10.0) (2023-08-30) - ### Features -* add `highlight.js@11` to `peerDependencies` ([#294](https://github.com/yandex-cloud/yfm-transform/issues/294)) ([d3c1869](https://github.com/yandex-cloud/yfm-transform/commit/d3c1869ded30cd0d62a29c86c324f1e0a7a4a4f5)) +- add `highlight.js@11` to `peerDependencies` ([#294](https://github.com/yandex-cloud/yfm-transform/issues/294)) ([d3c1869](https://github.com/yandex-cloud/yfm-transform/commit/d3c1869ded30cd0d62a29c86c324f1e0a7a4a4f5)) ## [3.9.1](https://github.com/yandex-cloud/yfm-transform/compare/v3.9.0...v3.9.1) (2023-08-28) - ### Bug Fixes -* thead tables' styles ([#292](https://github.com/yandex-cloud/yfm-transform/issues/292)) ([b49eb50](https://github.com/yandex-cloud/yfm-transform/commit/b49eb501a21e9bf8c914472cb68a6efd14ac74f8)) +- thead tables' styles ([#292](https://github.com/yandex-cloud/yfm-transform/issues/292)) ([b49eb50](https://github.com/yandex-cloud/yfm-transform/commit/b49eb501a21e9bf8c914472cb68a6efd14ac74f8)) ## [3.9.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.8.5...v3.9.0) (2023-08-23) - ### Features -* WIKI-19593: implementation of new table design ([#283](https://github.com/yandex-cloud/yfm-transform/issues/283)) ([c208540](https://github.com/yandex-cloud/yfm-transform/commit/c208540ce14d18a705e4f31469b4e291436a7550)) +- WIKI-19593: implementation of new table design ([#283](https://github.com/yandex-cloud/yfm-transform/issues/283)) ([c208540](https://github.com/yandex-cloud/yfm-transform/commit/c208540ce14d18a705e4f31469b4e291436a7550)) ## [3.8.5](https://github.com/yandex-cloud/yfm-transform/compare/v3.8.4...v3.8.5) (2023-08-15) - ### Bug Fixes -* Change runtime builder to esbuild ([e3f6cb0](https://github.com/yandex-cloud/yfm-transform/commit/e3f6cb0783a39ec333935b596e05f8ecb45b6af5)) +- Change runtime builder to esbuild ([e3f6cb0](https://github.com/yandex-cloud/yfm-transform/commit/e3f6cb0783a39ec333935b596e05f8ecb45b6af5)) ## [3.8.4](https://github.com/yandex-cloud/yfm-transform/compare/v3.8.3...v3.8.4) (2023-08-14) - ### Bug Fixes -* Fix tabs extension runtime import ([51f0323](https://github.com/yandex-cloud/yfm-transform/commit/51f03235320801382e25629fcd50d5baa541f4fe)) +- Fix tabs extension runtime import ([51f0323](https://github.com/yandex-cloud/yfm-transform/commit/51f03235320801382e25629fcd50d5baa541f4fe)) ## [3.8.3](https://github.com/yandex-cloud/yfm-transform/compare/v3.8.2...v3.8.3) (2023-08-12) - ### Bug Fixes -* **plugins/tabs:** update tabs extension version ([ddd2dc8](https://github.com/yandex-cloud/yfm-transform/commit/ddd2dc84ba181427811863303fcb75f9d814ff61)) +- **plugins/tabs:** update tabs extension version ([ddd2dc8](https://github.com/yandex-cloud/yfm-transform/commit/ddd2dc84ba181427811863303fcb75f9d814ff61)) ## [3.8.2](https://github.com/yandex-cloud/yfm-transform/compare/v3.8.1...v3.8.2) (2023-08-10) - ### Bug Fixes -* Fix tabs extension runtime import ([321006d](https://github.com/yandex-cloud/yfm-transform/commit/321006d0861ce480e6775dae681a5b2ee1f40008)) +- Fix tabs extension runtime import ([321006d](https://github.com/yandex-cloud/yfm-transform/commit/321006d0861ce480e6775dae681a5b2ee1f40008)) ## [3.8.1](https://github.com/yandex-cloud/yfm-transform/compare/v3.8.0...v3.8.1) (2023-08-10) - ### Bug Fixes -* **tabs-extension:** preserve tab items markup ([364ce16](https://github.com/yandex-cloud/yfm-transform/commit/364ce16c854898397c8a1f77d58c162a59ba13f6)) +- **tabs-extension:** preserve tab items markup ([364ce16](https://github.com/yandex-cloud/yfm-transform/commit/364ce16c854898397c8a1f77d58c162a59ba13f6)) ## [3.8.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.7.0...v3.8.0) (2023-08-09) - ### Features -* Update @diplodoc/tabs-extension version ([#268](https://github.com/yandex-cloud/yfm-transform/issues/268)) ([51a4ed2](https://github.com/yandex-cloud/yfm-transform/commit/51a4ed251904db640f7b98638b8e924cb849ab2e)) +- Update @diplodoc/tabs-extension version ([#268](https://github.com/yandex-cloud/yfm-transform/issues/268)) ([51a4ed2](https://github.com/yandex-cloud/yfm-transform/commit/51a4ed251904db640f7b98638b8e924cb849ab2e)) ## [3.7.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.6.1...v3.7.0) (2023-08-07) - ### Features -* raise tabs-extension npm version ([#264](https://github.com/yandex-cloud/yfm-transform/issues/264)) ([a7954bf](https://github.com/yandex-cloud/yfm-transform/commit/a7954bf9280c09e05dc26023951a7e4a120656b7)) +- raise tabs-extension npm version ([#264](https://github.com/yandex-cloud/yfm-transform/issues/264)) ([a7954bf](https://github.com/yandex-cloud/yfm-transform/commit/a7954bf9280c09e05dc26023951a7e4a120656b7)) ## [3.6.1](https://github.com/yandex-cloud/yfm-transform/compare/v3.6.0...v3.6.1) (2023-08-03) - ### Bug Fixes -* include @diplodoc/tabs-extension css ([#261](https://github.com/yandex-cloud/yfm-transform/issues/261)) ([c2a604a](https://github.com/yandex-cloud/yfm-transform/commit/c2a604ae0186cd00c7b4286b15bbbcb246c06a81)) +- include @diplodoc/tabs-extension css ([#261](https://github.com/yandex-cloud/yfm-transform/issues/261)) ([c2a604a](https://github.com/yandex-cloud/yfm-transform/commit/c2a604ae0186cd00c7b4286b15bbbcb246c06a81)) ## [3.6.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.5.0...v3.6.0) (2023-08-03) - ### Features -* Update @diplodoc/tabs-extension ([#259](https://github.com/yandex-cloud/yfm-transform/issues/259)) ([4a39991](https://github.com/yandex-cloud/yfm-transform/commit/4a3999144104c331786bbcbd62e8d4f02b9218f3)) +- Update @diplodoc/tabs-extension ([#259](https://github.com/yandex-cloud/yfm-transform/issues/259)) ([4a39991](https://github.com/yandex-cloud/yfm-transform/commit/4a3999144104c331786bbcbd62e8d4f02b9218f3)) ## [3.5.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.4.0...v3.5.0) (2023-07-31) - ### Features -* **tabs:** Start using @diplodoc/tabs-extension ([#257](https://github.com/yandex-cloud/yfm-transform/issues/257)) ([66b7f18](https://github.com/yandex-cloud/yfm-transform/commit/66b7f18a6ac98a1de6291721039dc9106b691243)) +- **tabs:** Start using @diplodoc/tabs-extension ([#257](https://github.com/yandex-cloud/yfm-transform/issues/257)) ([66b7f18](https://github.com/yandex-cloud/yfm-transform/commit/66b7f18a6ac98a1de6291721039dc9106b691243)) ## [3.4.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.3.2...v3.4.0) (2023-07-27) - ### Features -* **anchors:** Add anchors to headings in table ([feef516](https://github.com/yandex-cloud/yfm-transform/commit/feef516683ae309dd96ee25c9ee7d91cb30cf07e)) -* **diplodoc/term:** new terms ([9bf89ef](https://github.com/yandex-cloud/yfm-transform/commit/9bf89ef825d7f79c7bfacd77925a09b7b2e504ab)) - +- **anchors:** Add anchors to headings in table ([feef516](https://github.com/yandex-cloud/yfm-transform/commit/feef516683ae309dd96ee25c9ee7d91cb30cf07e)) +- **diplodoc/term:** new terms ([9bf89ef](https://github.com/yandex-cloud/yfm-transform/commit/9bf89ef825d7f79c7bfacd77925a09b7b2e504ab)) ### Bug Fixes -* link breaks anchored header since version ([6611151](https://github.com/yandex-cloud/yfm-transform/commit/66111515337dd396f9ad7255462173c01e86a9a5)), closes [#253](https://github.com/yandex-cloud/yfm-transform/issues/253) +- link breaks anchored header since version ([6611151](https://github.com/yandex-cloud/yfm-transform/commit/66111515337dd396f9ad7255462173c01e86a9a5)), closes [#253](https://github.com/yandex-cloud/yfm-transform/issues/253) ## [3.3.2](https://github.com/yandex-cloud/yfm-transform/compare/v3.3.1...v3.3.2) (2023-07-12) - ### Bug Fixes -* **plugins/table:** line map for table, table cell close tokens ([9600b7f](https://github.com/yandex-cloud/yfm-transform/commit/9600b7f8e22226be68dcbe570422c4c0b4a3abf5)) +- **plugins/table:** line map for table, table cell close tokens ([9600b7f](https://github.com/yandex-cloud/yfm-transform/commit/9600b7f8e22226be68dcbe570422c4c0b4a3abf5)) ## [3.3.1](https://github.com/yandex-cloud/yfm-transform/compare/v3.3.0...v3.3.1) (2023-07-07) - ### Bug Fixes -* **heading:** Double text in mini-toc ([2d0a700](https://github.com/yandex-cloud/yfm-transform/commit/2d0a7007c49c2de361ac6f9188fe417083cf8ae7)) +- **heading:** Double text in mini-toc ([2d0a700](https://github.com/yandex-cloud/yfm-transform/commit/2d0a7007c49c2de361ac6f9188fe417083cf8ae7)) ## [3.3.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.2.0...v3.3.0) (2023-07-07) - ### Features -* **anchors:** Revert rel=nofollow and add invisible title for anchor links ([8ea800d](https://github.com/yandex-cloud/yfm-transform/commit/8ea800d0a630ecd3a765bed493e13cf766c53912)) -* **cut:** decrease z-index of cut open/close icon ([39b5e38](https://github.com/yandex-cloud/yfm-transform/commit/39b5e380e35c002e548929942404053aaeaaa91e)) +- **anchors:** Revert rel=nofollow and add invisible title for anchor links ([8ea800d](https://github.com/yandex-cloud/yfm-transform/commit/8ea800d0a630ecd3a765bed493e13cf766c53912)) +- **cut:** decrease z-index of cut open/close icon ([39b5e38](https://github.com/yandex-cloud/yfm-transform/commit/39b5e380e35c002e548929942404053aaeaaa91e)) ## [3.2.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.1.3...v3.2.0) (2023-07-05) - ### Features -* **anchors:** Add rel=nofollow for anchor links ([cb0efae](https://github.com/yandex-cloud/yfm-transform/commit/cb0efae167721d81d966137baa7f3f5f85a75ae7)) +- **anchors:** Add rel=nofollow for anchor links ([cb0efae](https://github.com/yandex-cloud/yfm-transform/commit/cb0efae167721d81d966137baa7f3f5f85a75ae7)) ## [3.1.3](https://github.com/yandex-cloud/yfm-transform/compare/v3.1.2...v3.1.3) (2023-06-30) - ### Bug Fixes -* **plugins/tabs:** save line mapping for tabs ([3e695db](https://github.com/yandex-cloud/yfm-transform/commit/3e695db020fc6a02f0ca35e8d150e0f085d511b4)) +- **plugins/tabs:** save line mapping for tabs ([3e695db](https://github.com/yandex-cloud/yfm-transform/commit/3e695db020fc6a02f0ca35e8d150e0f085d511b4)) ## [3.1.2](https://github.com/yandex-cloud/yfm-transform/compare/v3.1.1...v3.1.2) (2023-06-21) - ### Bug Fixes -* **changelog:** date is not required ([#235](https://github.com/yandex-cloud/yfm-transform/issues/235)) ([b7b1c4d](https://github.com/yandex-cloud/yfm-transform/commit/b7b1c4dec78a5f0d64496ba182af3990412e2652)) -* **liquid:** move code indexes from global scope ([c877c48](https://github.com/yandex-cloud/yfm-transform/commit/c877c489745738031bba9ad8dbca38a5790815b4)) +- **changelog:** date is not required ([#235](https://github.com/yandex-cloud/yfm-transform/issues/235)) ([b7b1c4d](https://github.com/yandex-cloud/yfm-transform/commit/b7b1c4dec78a5f0d64496ba182af3990412e2652)) +- **liquid:** move code indexes from global scope ([c877c48](https://github.com/yandex-cloud/yfm-transform/commit/c877c489745738031bba9ad8dbca38a5790815b4)) ## [3.1.1](https://github.com/yandex-cloud/yfm-transform/compare/v3.1.0...v3.1.1) (2023-06-14) - ### Bug Fixes -* **plugins/checkbox:** preserve line mapping ([9ccee18](https://github.com/yandex-cloud/yfm-transform/commit/9ccee1834ccd7203f0528330c7d3498cd61558ea)) +- **plugins/checkbox:** preserve line mapping ([9ccee18](https://github.com/yandex-cloud/yfm-transform/commit/9ccee1834ccd7203f0528330c7d3498cd61558ea)) ## [3.1.0](https://github.com/yandex-cloud/yfm-transform/compare/v3.0.3...v3.1.0) (2023-06-01) - ### Features -* **changelog:** add support for changelog blocks ([#226](https://github.com/yandex-cloud/yfm-transform/issues/226)) ([8f5670b](https://github.com/yandex-cloud/yfm-transform/commit/8f5670bf4559f26cb9c88153089706d8163cef9b)) +- **changelog:** add support for changelog blocks ([#226](https://github.com/yandex-cloud/yfm-transform/issues/226)) ([8f5670b](https://github.com/yandex-cloud/yfm-transform/commit/8f5670bf4559f26cb9c88153089706d8163cef9b)) ## [3.0.3](https://github.com/yandex-cloud/yfm-transform/compare/v3.0.2...v3.0.3) (2023-05-30) - ### Bug Fixes -* **plugins/cuts:** preserve line mapping ([9eb93f9](https://github.com/yandex-cloud/yfm-transform/commit/9eb93f998fd21818ccf427799e39e1d5707f9e95)) +- **plugins/cuts:** preserve line mapping ([9eb93f9](https://github.com/yandex-cloud/yfm-transform/commit/9eb93f998fd21818ccf427799e39e1d5707f9e95)) ## [3.0.2](https://github.com/yandex-cloud/yfm-transform/compare/v3.0.1...v3.0.2) (2023-05-23) - ### Bug Fixes -* fonts ([2a0adfe](https://github.com/yandex-cloud/yfm-transform/commit/2a0adfef1078bae37d5cc228beff6a4ecb6f32f4)) +- fonts ([2a0adfe](https://github.com/yandex-cloud/yfm-transform/commit/2a0adfef1078bae37d5cc228beff6a4ecb6f32f4)) ## [3.0.1](https://github.com/yandex-cloud/yfm-transform/compare/v3.0.0...v3.0.1) (2023-05-22) - ### Bug Fixes -* **plugins/notes:** preserve line mapping ([29e4c5c](https://github.com/yandex-cloud/yfm-transform/commit/29e4c5c997d4a6933ac8330490f5bf9c07a9e3f1)) +- **plugins/notes:** preserve line mapping ([29e4c5c](https://github.com/yandex-cloud/yfm-transform/commit/29e4c5c997d4a6933ac8330490f5bf9c07a9e3f1)) ## [3.0.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.18.3...v3.0.0) (2023-05-10) - ### ⚠ BREAKING CHANGES -* font from variable +- font from variable ### Bug Fixes -* font from variable ([fed80ee](https://github.com/yandex-cloud/yfm-transform/commit/fed80ee7caed028330f6460cb05845b7d34ba689)) +- font from variable ([fed80ee](https://github.com/yandex-cloud/yfm-transform/commit/fed80ee7caed028330f6460cb05845b7d34ba689)) ## [2.18.3](https://github.com/yandex-cloud/yfm-transform/compare/v2.18.2...v2.18.3) (2023-04-20) - ### Bug Fixes -* Mark highlight.js as optional dependency ([cc24703](https://github.com/yandex-cloud/yfm-transform/commit/cc2470331f69abb7aa906a581ec0fd34ae63e13c)) +- Mark highlight.js as optional dependency ([cc24703](https://github.com/yandex-cloud/yfm-transform/commit/cc2470331f69abb7aa906a581ec0fd34ae63e13c)) ## [2.18.2](https://github.com/yandex-cloud/yfm-transform/compare/v2.18.1...v2.18.2) (2023-04-19) - ### Bug Fixes -* Make env.meta writeable ([f6540bd](https://github.com/yandex-cloud/yfm-transform/commit/f6540bd8578cc197c4cb4c5ee5e42ea5da97da13)) +- Make env.meta writeable ([f6540bd](https://github.com/yandex-cloud/yfm-transform/commit/f6540bd8578cc197c4cb4c5ee5e42ea5da97da13)) ## [2.18.1](https://github.com/yandex-cloud/yfm-transform/compare/v2.18.0...v2.18.1) (2023-04-14) - ### Bug Fixes -* **cut:** fix inline markup parsing in cut title ([d24413f](https://github.com/yandex-cloud/yfm-transform/commit/d24413f0398217a2793990bfffc9f8d205d38033)) -* **сheckbox:** fix inline markup parsing in the checkbox label ([ffa65a5](https://github.com/yandex-cloud/yfm-transform/commit/ffa65a5fae956267b57fea34ad1cc38fb132b118)) +- **cut:** fix inline markup parsing in cut title ([d24413f](https://github.com/yandex-cloud/yfm-transform/commit/d24413f0398217a2793990bfffc9f8d205d38033)) +- **сheckbox:** fix inline markup parsing in the checkbox label ([ffa65a5](https://github.com/yandex-cloud/yfm-transform/commit/ffa65a5fae956267b57fea34ad1cc38fb132b118)) ## [2.18.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.17.0...v2.18.0) (2023-04-06) - ### Features -* **sanitize:** allow 'allow' iframe attribute ([#214](https://github.com/yandex-cloud/yfm-transform/issues/214)) ([70d79b6](https://github.com/yandex-cloud/yfm-transform/commit/70d79b6e426d7e42d3bb9a422971e5b7fbb037fd)) +- **sanitize:** allow 'allow' iframe attribute ([#214](https://github.com/yandex-cloud/yfm-transform/issues/214)) ([70d79b6](https://github.com/yandex-cloud/yfm-transform/commit/70d79b6e426d7e42d3bb9a422971e5b7fbb037fd)) ## [2.17.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.16.4...v2.17.0) (2023-04-03) - ### Features -* **md:** Refactor transform index ([7df96ac](https://github.com/yandex-cloud/yfm-transform/commit/7df96ac626918ff21167dfce6daf9cf834d934d8)) - +- **md:** Refactor transform index ([7df96ac](https://github.com/yandex-cloud/yfm-transform/commit/7df96ac626918ff21167dfce6daf9cf834d934d8)) ### Bug Fixes -* wrap tab list on small screens ([#213](https://github.com/yandex-cloud/yfm-transform/issues/213)) ([cfb847e](https://github.com/yandex-cloud/yfm-transform/commit/cfb847edc752701829d3369d7c4c8889d7e11f93)) +- wrap tab list on small screens ([#213](https://github.com/yandex-cloud/yfm-transform/issues/213)) ([cfb847e](https://github.com/yandex-cloud/yfm-transform/commit/cfb847edc752701829d3369d7c4c8889d7e11f93)) ## [2.16.4](https://github.com/yandex-cloud/yfm-transform/compare/v2.16.3...v2.16.4) (2023-02-13) - ### Bug Fixes -* **liquid:** Add missed `contains` operator ([130c021](https://github.com/yandex-cloud/yfm-transform/commit/130c0210058edb3d49f77d42e05ddbbb0a5770c2)) -* **liquid:** Process large fence blocks ([0e97260](https://github.com/yandex-cloud/yfm-transform/commit/0e97260b32d995682112bf5f6339be1dd621fe59)) +- **liquid:** Add missed `contains` operator ([130c021](https://github.com/yandex-cloud/yfm-transform/commit/130c0210058edb3d49f77d42e05ddbbb0a5770c2)) +- **liquid:** Process large fence blocks ([0e97260](https://github.com/yandex-cloud/yfm-transform/commit/0e97260b32d995682112bf5f6339be1dd621fe59)) ## [2.16.3](https://github.com/yandex-cloud/yfm-transform/compare/v2.16.2...v2.16.3) (2023-01-26) - ### Bug Fixes -* fix sanitize-html package version ([#203](https://github.com/yandex-cloud/yfm-transform/issues/203)) ([3199c53](https://github.com/yandex-cloud/yfm-transform/commit/3199c533dfa9bae149d65ffee11c15ea7d6e266b)) +- fix sanitize-html package version ([#203](https://github.com/yandex-cloud/yfm-transform/issues/203)) ([3199c53](https://github.com/yandex-cloud/yfm-transform/commit/3199c533dfa9bae149d65ffee11c15ea7d6e266b)) ## [2.16.2](https://github.com/yandex-cloud/yfm-transform/compare/v2.16.1...v2.16.2) (2022-11-30) - ### Bug Fixes -* **include:** passing conditionsInCode through pluginOptions ([dfa986f](https://github.com/yandex-cloud/yfm-transform/commit/dfa986f50ab8bd380a04c81ab1444e5419c4d7ef)) +- **include:** passing conditionsInCode through pluginOptions ([dfa986f](https://github.com/yandex-cloud/yfm-transform/commit/dfa986f50ab8bd380a04c81ab1444e5419c4d7ef)) ## [2.16.1](https://github.com/yandex-cloud/yfm-transform/compare/v2.16.0...v2.16.1) (2022-11-29) - ### Bug Fixes -* **include:** support paths with sharp symbol ([a19bd3c](https://github.com/yandex-cloud/yfm-transform/commit/a19bd3c971f268d887527912c8bf833d78c09683)) +- **include:** support paths with sharp symbol ([a19bd3c](https://github.com/yandex-cloud/yfm-transform/commit/a19bd3c971f268d887527912c8bf833d78c09683)) ## [2.16.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.15.0...v2.16.0) (2022-11-08) - ### Features -* **checkbox:** add support for inline markup in checkbox label ([#194](https://github.com/yandex-cloud/yfm-transform/issues/194)) ([7582017](https://github.com/yandex-cloud/yfm-transform/commit/7582017ffb9d4f5befb0872af811d4453d629ee0)) - +- **checkbox:** add support for inline markup in checkbox label ([#194](https://github.com/yandex-cloud/yfm-transform/issues/194)) ([7582017](https://github.com/yandex-cloud/yfm-transform/commit/7582017ffb9d4f5befb0872af811d4453d629ee0)) ### Bug Fixes -* include src folder for sourcemaps ([e0c831d](https://github.com/yandex-cloud/yfm-transform/commit/e0c831d80b5232c4c301c10d54014927c3576627)) +- include src folder for sourcemaps ([e0c831d](https://github.com/yandex-cloud/yfm-transform/commit/e0c831d80b5232c4c301c10d54014927c3576627)) ## [2.15.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.14.2...v2.15.0) (2022-11-02) - ### Features -* add linkifyTlds option ([951fd7f](https://github.com/yandex-cloud/yfm-transform/commit/951fd7fbb8f6926dd3cd8256da927f00b1786b36)) - +- add linkifyTlds option ([951fd7f](https://github.com/yandex-cloud/yfm-transform/commit/951fd7fbb8f6926dd3cd8256da927f00b1786b36)) ### Bug Fixes -* add conditionsInCode and test ([00b5111](https://github.com/yandex-cloud/yfm-transform/commit/00b51112340522584cd62f43ae1baa445588dd83)) -* sup,sub line-height ([291fac7](https://github.com/yandex-cloud/yfm-transform/commit/291fac711eb94847a712da79b5631952ed8af977)) -* update test ([473d04a](https://github.com/yandex-cloud/yfm-transform/commit/473d04aa3140231fb7bcd9c3d6eac2a85b0839a2)) +- add conditionsInCode and test ([00b5111](https://github.com/yandex-cloud/yfm-transform/commit/00b51112340522584cd62f43ae1baa445588dd83)) +- sup,sub line-height ([291fac7](https://github.com/yandex-cloud/yfm-transform/commit/291fac711eb94847a712da79b5631952ed8af977)) +- update test ([473d04a](https://github.com/yandex-cloud/yfm-transform/commit/473d04aa3140231fb7bcd9c3d6eac2a85b0839a2)) ## [2.14.2](https://github.com/yandex-cloud/yfm-transform/compare/v2.14.1...v2.14.2) (2022-10-10) - ### Bug Fixes -* **checkbox:** fix input and label alignment ([#186](https://github.com/yandex-cloud/yfm-transform/issues/186)) ([dbe772d](https://github.com/yandex-cloud/yfm-transform/commit/dbe772d74a5b2a605e6b4b08a66885fcd250374d)) -* **checkbox:** make checkboxes non-editable ([#184](https://github.com/yandex-cloud/yfm-transform/issues/184)) ([097529f](https://github.com/yandex-cloud/yfm-transform/commit/097529f5aaa3a7f97ba88c2a8b8d4c78a7af9a1f)) +- **checkbox:** fix input and label alignment ([#186](https://github.com/yandex-cloud/yfm-transform/issues/186)) ([dbe772d](https://github.com/yandex-cloud/yfm-transform/commit/dbe772d74a5b2a605e6b4b08a66885fcd250374d)) +- **checkbox:** make checkboxes non-editable ([#184](https://github.com/yandex-cloud/yfm-transform/issues/184)) ([097529f](https://github.com/yandex-cloud/yfm-transform/commit/097529f5aaa3a7f97ba88c2a8b8d4c78a7af9a1f)) ## [2.14.1](https://github.com/yandex-cloud/yfm-transform/compare/v2.14.0...v2.14.1) (2022-09-20) - ### Bug Fixes -* **term:** custom header top coordinate ([#182](https://github.com/yandex-cloud/yfm-transform/issues/182)) ([8ebd61f](https://github.com/yandex-cloud/yfm-transform/commit/8ebd61f8c1388f42071427ac3c334a37e7ee88d6)) +- **term:** custom header top coordinate ([#182](https://github.com/yandex-cloud/yfm-transform/issues/182)) ([8ebd61f](https://github.com/yandex-cloud/yfm-transform/commit/8ebd61f8c1388f42071427ac3c334a37e7ee88d6)) ## [2.14.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.13.0...v2.14.0) (2022-09-15) - ### Features -* add html sanitizing [DOCSTOOLS-1350] ([#177](https://github.com/yandex-cloud/yfm-transform/issues/177)) ([634f7f8](https://github.com/yandex-cloud/yfm-transform/commit/634f7f80ceaac8c996aed33d6c2005ecb1c935a4)) +- add html sanitizing [DOCSTOOLS-1350] ([#177](https://github.com/yandex-cloud/yfm-transform/issues/177)) ([634f7f8](https://github.com/yandex-cloud/yfm-transform/commit/634f7f80ceaac8c996aed33d6c2005ecb1c935a4)) ## [2.13.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.12.0...v2.13.0) (2022-09-13) - ### Features -* Add term syntax DOCSTOOLS-1268 ([#172](https://github.com/yandex-cloud/yfm-transform/issues/172)) ([ddfb30b](https://github.com/yandex-cloud/yfm-transform/commit/ddfb30b08c823cececb385416e1d7b649298c5f2)) +- Add term syntax DOCSTOOLS-1268 ([#172](https://github.com/yandex-cloud/yfm-transform/issues/172)) ([ddfb30b](https://github.com/yandex-cloud/yfm-transform/commit/ddfb30b08c823cececb385416e1d7b649298c5f2)) ## [2.12.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.11.1...v2.12.0) (2022-09-08) - ### Features -* Enable imsize by default ([a77710f](https://github.com/yandex-cloud/yfm-transform/commit/a77710f6116a31462966ea466568bd48ab9dd80f)) +- Enable imsize by default ([a77710f](https://github.com/yandex-cloud/yfm-transform/commit/a77710f6116a31462966ea466568bd48ab9dd80f)) ## [2.11.1](https://github.com/yandex-cloud/yfm-transform/compare/v2.11.0...v2.11.1) (2022-09-07) - ### Bug Fixes -* **cut:** add title search inside path ([8966384](https://github.com/yandex-cloud/yfm-transform/commit/8966384375962bf61f08c083f9b0752aac49d8b2)) +- **cut:** add title search inside path ([8966384](https://github.com/yandex-cloud/yfm-transform/commit/8966384375962bf61f08c083f9b0752aac49d8b2)) ## [2.11.0](https://github.com/yandex-cloud/yfm-transform/compare/v2.10.5...v2.11.0) (2022-08-22) - ### Features -* **note:** allow inline formatting in note title ([2a8bc0f](https://github.com/yandex-cloud/yfm-transform/commit/2a8bc0fe796509440d0b6672ac7c14179992cafc)) +- **note:** allow inline formatting in note title ([2a8bc0f](https://github.com/yandex-cloud/yfm-transform/commit/2a8bc0fe796509440d0b6672ac7c14179992cafc)) ## [2.10.5](https://github.com/yandex-cloud/yfm-transform/compare/v2.10.4...v2.10.5) (2022-08-17) - ### Bug Fixes -* Update major dependencies ([1687c59](https://github.com/yandex-cloud/yfm-transform/commit/1687c595a2f5fe41d8c1d718c6b128a621c5f614)) +- Update major dependencies ([1687c59](https://github.com/yandex-cloud/yfm-transform/commit/1687c595a2f5fe41d8c1d718c6b128a621c5f614)) ## [2.10.4](https://github.com/yandex-cloud/yfm-transform/compare/v2.10.3...v2.10.4) (2022-08-17) - ### Bug Fixes -* Minor update dependencies ([20ba740](https://github.com/yandex-cloud/yfm-transform/commit/20ba7406eed7068384c661d6159b96b75d9791f7)) +- Minor update dependencies ([20ba740](https://github.com/yandex-cloud/yfm-transform/commit/20ba7406eed7068384c661d6159b96b75d9791f7)) ## [2.10.1](https://github.com/yandex-cloud/yfm-transform/compare/v2.10.0...v2.10.1) (2022-08-16) - ### Bug Fixes -* Add autorelease ([a946626](https://github.com/yandex-cloud/yfm-transform/commit/a946626804f76afc9e1fe7fbd472931df24e73e1)) -* Fix autorelease ([2d6bcf7](https://github.com/yandex-cloud/yfm-transform/commit/2d6bcf75ee8c38ed9c913c03eb92dc844fb2beae)) +- Add autorelease ([a946626](https://github.com/yandex-cloud/yfm-transform/commit/a946626804f76afc9e1fe7fbd472931df24e73e1)) +- Fix autorelease ([2d6bcf7](https://github.com/yandex-cloud/yfm-transform/commit/2d6bcf75ee8c38ed9c913c03eb92dc844fb2beae)) diff --git a/src/transform/fsContext.ts b/src/transform/fsContext.ts new file mode 100644 index 00000000..42cf7c24 --- /dev/null +++ b/src/transform/fsContext.ts @@ -0,0 +1,37 @@ +import {readFileSync, writeFileSync} from 'fs'; +import {readFile, writeFile} from 'fs/promises'; + +import {FsContext} from './typings'; +import {isFileExists, isFileExistsAsync} from './utilsFS'; + +export class DefaultFsContext implements FsContext { + exist(path: string): boolean { + return isFileExists(path); + } + + read(path: string): string { + return readFileSync(path, 'utf8'); + } + + write(path: string, content: string): void { + writeFileSync(path, content, { + encoding: 'utf8', + }); + } + + async existAsync(path: string): Promise { + return await isFileExistsAsync(path); + } + + async readAsync(path: string): Promise { + return readFile(path, 'utf8'); + } + + async writeAsync(path: string, content: string): Promise { + writeFile(path, content, { + encoding: 'utf8', + }); + } +} + +export const defaultFsContext = new DefaultFsContext(); diff --git a/src/transform/plugins/images/collect.ts b/src/transform/plugins/images/collect.ts index f67e4671..c5c0579b 100644 --- a/src/transform/plugins/images/collect.ts +++ b/src/transform/plugins/images/collect.ts @@ -12,21 +12,21 @@ type Options = MarkdownItPluginOpts & { singlePage: boolean; }; -const collect = (input: string, options: Options) => { +const collect = async (input: string, options: Options) => { const md = new MarkdownIt().use(imsize); - const {root, path, destPath = '', copyFile, singlePage} = options; + const {root, path, destPath = '', copyFile, singlePage, deps} = options; const tokens = md.parse(input, {}); let result = input; - tokens.forEach((token) => { + for (const token of tokens) { if (token.type !== 'inline') { return; } const children = token.children || []; - children.forEach((childToken) => { + for (const childToken of children) { if (childToken.type !== 'image') { return; } @@ -40,15 +40,16 @@ const collect = (input: string, options: Options) => { const targetPath = resolveRelativePath(path, src); const targetDestPath = resolveRelativePath(destPath, src); - if (singlePage && !path.includes('_includes/')) { - const newSrc = relative(root, resolveRelativePath(path, src)); + deps?.markDep?.(path, targetPath, 'image'); + if (singlePage && !path.includes('_includes/')) { + const newSrc = relative(root, targetPath); result = result.replace(src, newSrc); } - copyFile(targetPath, targetDestPath); - }); - }); + await copyFile(targetPath, targetDestPath); + } + } if (singlePage) { return result; diff --git a/src/transform/plugins/images/index.ts b/src/transform/plugins/images/index.ts index 7684b2d9..7ed8a81c 100644 --- a/src/transform/plugins/images/index.ts +++ b/src/transform/plugins/images/index.ts @@ -2,12 +2,12 @@ import {join, sep} from 'path'; import {bold} from 'chalk'; import {optimize} from 'svgo'; import Token from 'markdown-it/lib/token'; -import {readFileSync} from 'fs'; -import {isFileExists, resolveRelativePath} from '../../utilsFS'; +import {resolveRelativePath} from '../../utilsFS'; import {isExternalHref, isLocalUrl} from '../../utils'; import {MarkdownItPluginCb, MarkdownItPluginOpts} from '../typings'; -import {StateCore} from '../../typings'; +import {FsContext, StateCore} from '../../typings'; +import {defaultFsContext} from '../../fsContext'; interface ImageOpts extends MarkdownItPluginOpts { assetsPublicPath: string; @@ -15,9 +15,10 @@ interface ImageOpts extends MarkdownItPluginOpts { } function replaceImageSrc( + fs: FsContext, token: Token, state: StateCore, - {assetsPublicPath = sep, root = '', path: optsPath, log}: ImageOpts, + {assetsPublicPath = sep, root = '', path: optsPath, log, deps}: ImageOpts, ) { const src = token.attrGet('src') || ''; const currentPath = state.env.path || optsPath; @@ -28,7 +29,9 @@ function replaceImageSrc( const path = resolveRelativePath(currentPath, src); - if (isFileExists(path)) { + deps?.markDep?.(currentPath, path, 'image'); + + if (fs.exist(path)) { state.md.assets?.push(path); } else { log.error(`Asset not found: ${bold(src)} in ${bold(currentPath)}`); @@ -51,15 +54,18 @@ function prefix() { } function convertSvg( + fs: FsContext, token: Token, state: StateCore, - {path: optsPath, log, notFoundCb, root}: SVGOpts, + {path: optsPath, log, notFoundCb, root, deps}: SVGOpts, ) { const currentPath = state.env.path || optsPath; const path = resolveRelativePath(currentPath, token.attrGet('src') || ''); try { - const raw = readFileSync(path).toString(); + deps?.markDep?.(currentPath, path, 'image'); + + const raw = fs.read(path).toString(); const result = optimize(raw, { plugins: [ { @@ -90,6 +96,8 @@ function convertSvg( type Opts = SVGOpts & ImageOpts; const index: MarkdownItPluginCb = (md, opts) => { + const fs = opts.fs ?? defaultFsContext; + md.assets = []; const plugin = (state: StateCore) => { @@ -117,9 +125,9 @@ const index: MarkdownItPluginCb = (md, opts) => { const shouldInlineSvg = opts.inlineSvg !== false && !isExternalHref(imgSrc); if (imgSrc.endsWith('.svg') && shouldInlineSvg) { - childrenTokens[j] = convertSvg(childrenTokens[j], state, opts); + childrenTokens[j] = convertSvg(fs, childrenTokens[j], state, opts); } else { - replaceImageSrc(childrenTokens[j], state, opts); + replaceImageSrc(fs, childrenTokens[j], state, opts); } childrenTokens[j].attrSet('yfm_patched', '1'); diff --git a/src/transform/plugins/includes/collect.ts b/src/transform/plugins/includes/collect.ts index d5522443..a7c5acdb 100644 --- a/src/transform/plugins/includes/collect.ts +++ b/src/transform/plugins/includes/collect.ts @@ -1,19 +1,24 @@ import {relative} from 'path'; import {bold} from 'chalk'; -import {readFileSync} from 'fs'; -import {getRelativePath, isFileExists, resolveRelativePath} from '../../utilsFS'; +import {getRelativePath, resolveRelativePath} from '../../utilsFS'; +import {defaultFsContext} from '../../fsContext'; import {IncludeCollectOpts} from './types'; -const includesPaths: string[] = []; - -function processRecursive( +async function processRecursive( includePath: string, targetDestPath: string, options: IncludeCollectOpts, ) { - const {path, log, copyFile, includedParentPath: includedParentPathNullable, included} = options; + const { + path, + log, + copyFile, + includedParentPath: includedParentPathNullable, + included, + fs, + } = options; const includedParentPath = includedParentPathNullable || path; const includeOptions = { @@ -23,11 +28,11 @@ function processRecursive( }; try { - const contentProcessed = copyFile(includePath, targetDestPath, includeOptions); + const contentProcessed = await copyFile(includePath, targetDestPath, includeOptions); // To reduce file reading we can include the file content into the generated content if (included) { - const content = contentProcessed ?? readFileSync(targetDestPath, 'utf8'); + const content = contentProcessed ?? (await fs?.readAsync(targetDestPath)); if (content) { const includedRelativePath = getRelativePath(includedParentPath, includePath); @@ -35,7 +40,7 @@ function processRecursive( // The appendix is the map that protects from multiple include files if (!options.appendix?.has(includedRelativePath)) { // Recursive function to include the depth structure - const includeContent = collectRecursive(content, { + const includeContent = await collectRecursive(content, { ...options, path: includePath, includedParentPath, @@ -54,8 +59,8 @@ function processRecursive( } } -function collectRecursive(result: string, options: IncludeCollectOpts) { - const {root, path, destPath = '', log, singlePage} = options; +async function collectRecursive(result: string, options: IncludeCollectOpts) { + const {root, path, destPath = '', log, singlePage, fs = defaultFsContext, deps} = options; const INCLUDE_REGEXP = /{%\s*include\s*(notitle)?\s*\[(.+?)]\((.+?)\)\s*%}/g; @@ -67,19 +72,24 @@ function collectRecursive(result: string, options: IncludeCollectOpts) { let includePath = resolveRelativePath(path, relativePath); const hashIndex = relativePath.lastIndexOf('#'); - if (hashIndex > -1 && !isFileExists(includePath)) { + + deps?.markDep?.(path, includePath, 'include'); + + if (hashIndex > -1 && !(await fs.existAsync(includePath))) { includePath = includePath.slice(0, includePath.lastIndexOf('#')); relativePath = relativePath.slice(0, hashIndex); } const targetDestPath = resolveRelativePath(destPath, relativePath); - if (includesPaths.includes(includePath)) { - log.error(`Circular includes: ${bold(includesPaths.concat(path).join(' ▶ '))}`); + if (options.includesPaths?.includes(includePath)) { + log.error( + `Circular includes: ${bold(options.includesPaths?.concat(path).join(' ▶ '))}`, + ); break; } - if (singlePage && !includesPaths.length) { + if (singlePage && !options.includesPaths?.length) { const newRelativePath = relative(root, includePath); const newInclude = matchedInclude.replace(relativePath, newRelativePath); @@ -89,22 +99,23 @@ function collectRecursive(result: string, options: IncludeCollectOpts) { INCLUDE_REGEXP.lastIndex = INCLUDE_REGEXP.lastIndex - delta; } - includesPaths.push(includePath); + options.includesPaths?.push(includePath); - processRecursive(includePath, targetDestPath, options); + await processRecursive(includePath, targetDestPath, options); - includesPaths.pop(); + options.includesPaths?.pop(); } return result; } -function collect(input: string, options: IncludeCollectOpts) { +async function collect(input: string, options: IncludeCollectOpts) { const shouldWriteAppendix = !options.appendix; + options.includesPaths = options.includesPaths ?? []; options.appendix = options.appendix ?? new Map(); - input = collectRecursive(input, options); + input = await collectRecursive(input, options); if (shouldWriteAppendix) { // Appendix should be appended to the end of the file (it supports depth structure, so the included files will have included as well) diff --git a/src/transform/plugins/includes/index.ts b/src/transform/plugins/includes/index.ts index 85b30797..63fac960 100644 --- a/src/transform/plugins/includes/index.ts +++ b/src/transform/plugins/includes/index.ts @@ -1,15 +1,15 @@ import {bold} from 'chalk'; import Token from 'markdown-it/lib/token'; -import {StateCore} from '../../typings'; import { GetFileTokensOpts, getFileTokens, getFullIncludePath, - isFileExists, resolveRelativePath, } from '../../utilsFS'; import {findBlockTokens} from '../../utils'; +import {StateCore} from '../../typings'; +import {defaultFsContext} from '../../fsContext'; import {MarkdownItPluginCb, MarkdownItPluginOpts} from '../typings'; import {MarkdownItIncluded} from './types'; @@ -29,7 +29,7 @@ type Options = MarkdownItPluginOpts & }; function unfoldIncludes(md: MarkdownItIncluded, state: StateCore, path: string, options: Options) { - const {root, notFoundCb, log, noReplaceInclude = false} = options; + const {root, notFoundCb, log, noReplaceInclude = false, fs = defaultFsContext, deps} = options; const {tokens} = state; let i = 0; @@ -57,7 +57,11 @@ function unfoldIncludes(md: MarkdownItIncluded, state: StateCore, path: string, let pathname = fullIncludePath; let hash = ''; const hashIndex = fullIncludePath.lastIndexOf('#'); - if (hashIndex > -1 && !isFileExists(pathname)) { + const existed = fs.exist(pathname); + + deps?.markDep?.(path, pathname, 'include'); + + if (hashIndex > -1 && !existed) { pathname = fullIncludePath.slice(0, hashIndex); hash = fullIncludePath.slice(hashIndex + 1); } @@ -68,7 +72,7 @@ function unfoldIncludes(md: MarkdownItIncluded, state: StateCore, path: string, continue; } - const fileTokens = getFileTokens(pathname, state, { + const fileTokens = getFileTokens(fs, pathname, state, { ...options, content: included, // The content forces the function to use it instead of reading from the disk }); diff --git a/src/transform/plugins/includes/types.ts b/src/transform/plugins/includes/types.ts index 341af7d8..76ce047e 100644 --- a/src/transform/plugins/includes/types.ts +++ b/src/transform/plugins/includes/types.ts @@ -9,10 +9,15 @@ export interface MarkdownItIncluded extends MarkdownIt { export type IncludeCollectOpts = MarkdownItPluginOpts & { destPath: string; - copyFile(path: string, dest: string, opts: IncludeCollectOpts): string | null | undefined; + copyFile( + path: string, + dest: string, + opts: IncludeCollectOpts, + ): Promise; singlePage: Boolean; included: Boolean; includedParentPath?: string; additionalIncludedList?: string[]; + includesPaths?: string[]; appendix?: Map; }; diff --git a/src/transform/plugins/links/collect.ts b/src/transform/plugins/links/collect.ts index a7166b04..dae6fd03 100644 --- a/src/transform/plugins/links/collect.ts +++ b/src/transform/plugins/links/collect.ts @@ -4,6 +4,7 @@ import url from 'url'; import {PAGE_LINK_REGEXP, getHrefTokenAttr, isLocalUrl} from '../../utils'; import {getSinglePageAnchorId, resolveRelativePath} from '../../utilsFS'; +import {MarkdownItPluginOpts} from '../typings'; import index from './index'; @@ -12,9 +13,7 @@ const replaceLinkHref = (input: string, href: string, newHref: string) => { return input.replace(`](${href})`, `](${newHref})`); }; -type Options = { - root: string; - path: string; +type Options = MarkdownItPluginOpts & { singlePage: boolean; }; @@ -22,7 +21,7 @@ type Options = { * Example: replace [Text](../../path/to/file.md#anchor) with [Text](#_path_to_file_anchor) * */ const collect = (input: string, options: Options) => { - const {root, path: startPath, singlePage} = options; + const {root, path: startPath, singlePage, deps} = options; if (!singlePage) { return; @@ -66,6 +65,8 @@ const collect = (input: string, options: Options) => { if (pathname) { const isPageFile = PAGE_LINK_REGEXP.test(pathname); if (isPageFile) { + deps?.markDep?.(startPath, pathname, 'link'); + const newHref = getSinglePageAnchorId({ root, currentPath: startPath, diff --git a/src/transform/plugins/links/index.ts b/src/transform/plugins/links/index.ts index 4e976c13..e5a4917a 100644 --- a/src/transform/plugins/links/index.ts +++ b/src/transform/plugins/links/index.ts @@ -1,9 +1,7 @@ import url from 'url'; import {bold} from 'chalk'; -import Token from 'markdown-it/lib/token'; import path, {isAbsolute, parse, relative, resolve} from 'path'; - -import {Logger} from 'src/transform/log'; +import Token from 'markdown-it/lib/token'; import { PAGE_LINK_REGEXP, @@ -13,8 +11,10 @@ import { headingInfo, isLocalUrl, } from '../../utils'; -import {getFileTokens, isFileExists} from '../../utilsFS'; -import {CacheContext, StateCore} from '../../typings'; +import {getFileTokens} from '../../utilsFS'; +import {Logger} from '../../log'; +import {CacheContext, FsContext, StateCore} from '../../typings'; +import {defaultFsContext} from '../../fsContext'; import {MarkdownItPluginCb, MarkdownItPluginOpts} from '../typings'; function getTitleFromTokens(tokens: Token[]) { @@ -49,12 +49,13 @@ type Options = { currentPath: string; log: Logger; cache?: CacheContext; + fs: FsContext; }; const getTitle = (id: string | null, options: Options) => { const {file, state, opts} = options; - const fileTokens = getFileTokens(file, state, { + const fileTokens = getFileTokens(options.fs, file, state, { ...opts, disableLint: true, disableTitleRefSubstitution: true, @@ -121,6 +122,8 @@ function processLink(state: StateCore, tokens: Token[], idx: number, opts: ProcO log, getPublicPath = getDefaultPublicPath, cache, + fs = defaultFsContext, + deps, } = opts; const currentPath = state.env.path || startPath; @@ -147,9 +150,13 @@ function processLink(state: StateCore, tokens: Token[], idx: number, opts: ProcO if (pathname) { file = resolve(path.parse(currentPath).dir, pathname); - fileExists = isFileExists(file); + fileExists = fs.exist(file); isPageFile = PAGE_LINK_REGEXP.test(pathname); + if (isPageFile) { + deps?.markDep?.(currentPath, file, 'link'); + } + if (isPageFile && !fileExists) { let needShowError = true; if (needSkipLinkFn) { @@ -193,6 +200,7 @@ function processLink(state: StateCore, tokens: Token[], idx: number, opts: ProcO currentPath, log, cache, + fs, }); } diff --git a/src/transform/typings.ts b/src/transform/typings.ts index 77f19743..9ff77ccd 100644 --- a/src/transform/typings.ts +++ b/src/transform/typings.ts @@ -29,6 +29,38 @@ export type Heading = { items?: Heading[]; }; +export interface FsContext { + read(path: string | null): string; + exist(path: string | null): boolean; + write(path: string | null, content: string): void; + readAsync(path: string | null): Promise; + existAsync(path: string | null): Promise; + writeAsync(path: string | null, content: string): Promise; +} + +export interface DependencyContext { + resetDeps?(path: string): void; + markDep?(path: string, dependencyPath: string, type?: string): void; + unmarkDep?(path: string, dependencyPath: string, type?: string): void; +} + +export interface RevisionMeta { + files: { + [key: string]: { + mod_date: number; // modified_at + dependencies: { + [type: string]: string[]; + }; + changed: boolean; + }; + }; +} + +export interface RevisionContext { + files: string[]; + meta: RevisionMeta; +} + export interface OptionsType { vars?: Record; path?: string; @@ -58,6 +90,9 @@ export interface OptionsType { getPublicPath?: (options: OptionsType, href?: string) => string; renderInline?: boolean; cache?: CacheContext; + context?: RevisionContext; + fs?: FsContext; + deps?: DependencyContext; [x: string]: unknown; } @@ -84,6 +119,9 @@ export interface MarkdownItPluginOpts { rootPublicPath: string; isLintRun: boolean; cache?: CacheContext; + context?: RevisionContext; + fs?: FsContext; + deps?: DependencyContext; conditionsInCode?: boolean; vars?: Record; extractTitle?: boolean; diff --git a/src/transform/utilsFS.ts b/src/transform/utilsFS.ts index f8accb8b..d349b2ce 100644 --- a/src/transform/utilsFS.ts +++ b/src/transform/utilsFS.ts @@ -1,25 +1,14 @@ import type {Dictionary} from 'lodash'; -import {readFileSync, statSync} from 'fs'; import escapeRegExp from 'lodash/escapeRegExp'; import {join, parse, relative, resolve, sep} from 'path'; +import {statSync} from 'fs'; +import {stat} from 'fs/promises'; import liquidSnippet from './liquid'; -import {StateCore} from './typings'; +import {FsContext, StateCore} from './typings'; import {defaultTransformLink} from './utils'; -const filesCache: Record = {}; - -export function isFileExists(file: string) { - try { - const stats = statSync(file); - - return stats.isFile(); - } catch (e) { - return false; - } -} - export function resolveRelativePath(fromPath: string, relativePath: string) { const {dir: fromDir} = parse(fromPath); @@ -39,7 +28,32 @@ export type GetFileTokensOpts = { content?: string; }; -export function getFileTokens(path: string, state: StateCore, options: GetFileTokensOpts) { +export function isFileExists(file: string) { + try { + const stats = statSync(file); + + return stats.isFile(); + } catch (e) { + return false; + } +} + +export async function isFileExistsAsync(file: string) { + try { + const stats = await stat(file); + + return stats.isFile(); + } catch (e) { + return false; + } +} + +export function getFileTokens( + fs: FsContext, + path: string, + state: StateCore, + options: GetFileTokensOpts, +) { const { getVarsPerFile, vars, @@ -57,12 +71,7 @@ export function getFileTokens(path: string, state: StateCore, options: GetFileTo // Read the content only if we dont have one in the args if (!content) { - if (filesCache[path]) { - content = filesCache[path]; - } else { - content = readFileSync(path, 'utf8'); - filesCache[path] = content; - } + content = fs.read(path); } let sourceMap; diff --git a/test/include-included.test.ts b/test/include-included.test.ts index ee7ccbe6..4f26c9c4 100644 --- a/test/include-included.test.ts +++ b/test/include-included.test.ts @@ -1,5 +1,4 @@ import {resolve} from 'path'; -import {readFileSync} from 'fs'; import {readFile} from 'node:fs/promises'; import transform from '../src/transform'; @@ -26,7 +25,7 @@ const collectIncluded = (text: string, path: string) => { included: true, path: path, root: resolve(path, '../'), - copyFile: (includePath) => readFileSync(includePath, 'utf-8'), + copyFile: (includePath) => readFile(includePath, 'utf-8'), singlePage: false, destPath: '', isLintRun: false, @@ -46,7 +45,7 @@ describe('Included to md', () => { const expectPath = resolve(__dirname, './mocks/include-included-3.expect.md'); const expectContent = await readFile(expectPath, 'utf8'); - const result = collectIncluded(input, inputPath); + const result = await collectIncluded(input, inputPath); expect(result).toBe(expectContent); }); @@ -70,7 +69,7 @@ describe('Included to md', () => { const expectPath = resolve(__dirname, './mocks/include-included-3-deep.expect.md'); const expectContent = await readFile(expectPath, 'utf8'); - const result = collectIncluded(input, inputPath); + const result = await collectIncluded(input, inputPath); expect(result).toBe(expectContent); });