From faaebe8b8b85a6e4680a286f24ff963db097cc66 Mon Sep 17 00:00:00 2001 From: Naoto Kato Date: Mon, 11 Apr 2022 15:55:59 +0900 Subject: [PATCH] feat: Added table support --- .editorconfig | 0 .github/FUNDING.yml | 0 .github/workflows/build.yml | 0 .github/workflows/publish.yml | 0 .gitignore | 0 .idea/.name | 0 .idea/codeStyles/Project.xml | 0 .idea/codeStyles/codeStyleConfig.xml | 0 .idea/inspectionProfiles/Project_Default.xml | 0 .idea/modules.xml | 0 .idea/node-html-markdown.iml | 0 .idea/vcs.xml | 0 CHANGELOG.md | 0 README.md | 0 benchmark/LICENSE.md | 0 benchmark/README.md | 0 benchmark/_run.js | 0 benchmark/execute.js | 0 ...1fe65500ad1cb58c7f45b34251db7056803ec.html | 0 ...54e07dccaa501bd9a1c0f1c545533bde1650b.html | 0 ...161e442e9431c4580295f1ba4ece22741068c.html | 0 ...80257a382fe792a3d4d8531fb285cd74c3492.html | 0 ...7ea5398fa9a1e83493d55844b479506a80fd8.html | 0 ...d5d37a92b2806bf7a88b906c28b90a635f82a.html | 0 ...83dd74d7aa9c742688ca4c386b75693547bd3.html | 0 ...25dbe8174f6e57f0b0316644cefd30979f096.html | 0 ...68c3b18f1e934530d05cb1f579ad3347d135c.html | 0 ...d9eafb9f650c67ba048411b04dc77a745dc39.html | 0 ...9f45a49efd7edca19dc896ca0983a4bf41485.html | 0 ...72a2ad755566bd4a6bc17d10dc95a51d74d65.html | 0 ...adc72bceb491a03ed608debb72a90bce65c50.html | 0 ...ffffeae3f409aa73d9b82853f65535116f68f.html | 0 ...013a5837992e7bcdb1f6cacd7d475f9784273.html | 0 ...4093362b9193523c6e35cfb7dc086c8ef8648.html | 0 ...7d32792df87779bdf1f86c3b21e15fbf3161d.html | 0 ...b20a535979a32972f5005e2af577b37980e48.html | 0 ...2ae16ba592b426dd4141da8a383b183aa3a37.html | 0 ...53e1d7d68e3af927b09efad3dae7ce2080567.html | 0 ...9575c675c963e949cda52147a044bbfa77559.html | 0 ...37cd19ffc75494c9172755f1a961ba32e75dd.html | 0 ...e510ed098087679df7e0e564d6dd32152d679.html | 0 ...030eac3a6d818966d91c67b406431ff9bdf05.html | 0 ...cd422eb0c6a0fdfe4da79531931ad93dd4940.html | 0 ...34d55cff06260a3e63245856a6e57fcda5906.html | 0 ...b54ee054fb561022e169c8fdbe321dcf672db.html | 0 ...0530b65f2a6b61a5e529e1d3664630d4897ee.html | 0 ...f794c3309e52c018a8156ef9aedfedf0572e7.html | 0 ...2a0899f8ab6d8d4db1aa57fa4418b8b7e0a5d.html | 0 ...91d200a6c7d545fed2454916bedbb0f666086.html | 0 ...33619d30bde1e80a816c78d00358eb61e353c.html | 0 ...b0ff79e305dedb9ece5f8ec66396ea378f723.html | 0 ...5cd2eff1671de9d3d27852a38abd76a95be83.html | 0 ...669cd82cc36a518caa7f66fc6ba5be4ac545b.html | 0 ...08310c52121fd382c06314d5b33d7f47c1e94.html | 0 ...78aaa0c1a2b5b5920a72223f3a090e39df8be.html | 0 ...6a28eb112e535559c194d7976fb664c922c13.html | 0 ...e6773dee6844e28889ae66ccb8d7458a9c5bb.html | 0 ...dc4caeb63a4d7b709e4441510d2c1967e0e6f.html | 0 ...8bde78947841c8fd1ff3c36efa95ee84681f6.html | 0 ...ee597fea1dbfc8399d61015956db71e5336c7.html | 0 ...deb9df10479e29fc92ff07c77c4cb9d2c3f21.html | 0 ...1073e5d0996d3f250a697398477d3642db321.html | 0 ...6e517b41f764d5b4ca404c1ceff3fe22bdda8.html | 0 ...c0f3066a70cb5fadeea81f28d371681a2dee8.html | 0 ...bfd3d26362971e39fe8838e7ac548ba323cf0.html | 0 ...c2d010edae448b8c832bff2254125e4b51d5f.html | 0 ...cccc001f9ec2e3b7a77926d350762bcd02400.html | 0 ...fa747e9467692d099a3e9e42246e7af29748f.html | 0 ...fd268fec46fbefa40b486d288d2a07871a527.html | 0 ...c98a4b09aa0516ebfe4982233a6c33d129691.html | 0 ...c70f43a4fac9303d549256d88b8f7cecadd50.html | 0 ...99256163bd3aef20deae3015f74e5bb253e55.html | 0 ...b1928d9a2b45bb79767515383b8444e9601b2.html | 0 ...6547c8866ae8aa95f5991651d94c68df4ad1d.html | 0 ...d10b763443a71dbb6dd202402843de8a5e331.html | 0 ...a98a3714ea2998e2c2e2a94c46dbe92176feb.html | 0 ...ce9a55c4ef1e31477f9a8ffb7f4d3bba8c559.html | 0 ...10088904adb77b49211cdd99e43e5870e06c2.html | 0 ...2f80e59e3e126735fae0b5ee5914ff2fce48e.html | 0 ...b46c8a479429d8429c36dc03b033d7e4891df.html | 0 ...e60885af5eee4b9f28beb6b8363bb70c820f9.html | 0 ...7ef2e530a2ff0c2cea7641ebb596a4a1b8008.html | 0 ...5278babdac18bb78a742052fd946001c28e4e.html | 0 ...d2138733b66b30b5211e7f3245dd6dc3ca36c.html | 0 ...9a2916029ef3d9e431d056d5f548c0f771d16.html | 0 ...284acc71703ccfa0f0c89ec292b4245fd0521.html | 0 ...8ab8e58e95a8e784613e75f106cdef17868d6.html | 0 ...d2885cafd0da3f2afb146cf2822448c3c4104.html | 0 ...3a57899fdba4b755bd50df01a053c262d354e.html | 0 ...b38a35660f50a88c4305b23a8f24f254da8cb.html | 0 ...b4b10af4187f069a988e12c2f91d2ba40cdc1.html | 0 ...5727c88c94808ad92e37a0f6e99dcb3888800.html | 0 ...bc428e5299c7443ecad6cc56c0076287fe11a.html | 0 ...12b59c3f092e73cffcc9332261fbab4aa16e1.html | 0 ...f18adc1a2fc0f1f3a0c95a3e166e41ffb737d.html | 0 ...f53b2b580ce87083e0a756ade3d83627d5653.html | 0 ...e7fd1413dcc1955110829d849a658aa722bea.html | 0 ...06121661cd9c8809f564eabb660149577864d.html | 0 ...6c9590da90fbeb91ac50938cdfa36dd274e23.html | 0 ...b9b6458b48d7b8c36cf2bf804fba290b302f5.html | 0 ...193f580e869db7869358af822d7d2d4c0388e.html | 0 ...486d43644955dee7f73cc004b9cf1693a11c1.html | 0 ...8b23f9f18494d2653a1b547086a3973fff93c.html | 0 ...498672324cda5f76314d7ea10913f63cf3545.html | 0 ...ed0ccb27d9f908f252690b083d48db64ea15a.html | 0 benchmark/index.js | 0 benchmark/package.json | 0 benchmark/wrapper/node-html-makrdown_reuse.js | 0 benchmark/wrapper/node-html-markdown.js | 0 benchmark/wrapper/turndown.js | 0 benchmark/wrapper/turndown_reuse.js | 0 benchmark/yarn.lock | 0 jest.config.js | 0 package.json | 0 src/config.ts | 110 +++++++++++++++++- src/index.ts | 0 src/main.ts | 15 ++- src/nodes.ts | 0 src/options.ts | 0 src/translator.ts | 5 + src/utilities.ts | 0 src/visitor.ts | 13 ++- test/default-tags-codeblock.test.ts | 5 + test/default-tags.test.ts | 0 test/special-cases.test.ts | 0 test/table.test.ts | 102 ++++++++++++++++ test/tsconfig.json | 0 transformer.js | 0 tsconfig.base.json | 0 tsconfig.json | 0 yarn.lock | 0 131 files changed, 246 insertions(+), 4 deletions(-) mode change 100755 => 100644 .editorconfig mode change 100755 => 100644 .github/FUNDING.yml mode change 100755 => 100644 .github/workflows/build.yml mode change 100755 => 100644 .github/workflows/publish.yml mode change 100755 => 100644 .gitignore mode change 100755 => 100644 .idea/.name mode change 100755 => 100644 .idea/codeStyles/Project.xml mode change 100755 => 100644 .idea/codeStyles/codeStyleConfig.xml mode change 100755 => 100644 .idea/inspectionProfiles/Project_Default.xml mode change 100755 => 100644 .idea/modules.xml mode change 100755 => 100644 .idea/node-html-markdown.iml mode change 100755 => 100644 .idea/vcs.xml mode change 100755 => 100644 CHANGELOG.md mode change 100755 => 100644 README.md mode change 100755 => 100644 benchmark/LICENSE.md mode change 100755 => 100644 benchmark/README.md mode change 100755 => 100644 benchmark/_run.js mode change 100755 => 100644 benchmark/execute.js mode change 100755 => 100644 benchmark/files/039c4b966d1f2a0c589ac0aad211fe65500ad1cb58c7f45b34251db7056803ec.html mode change 100755 => 100644 benchmark/files/06ed0a833361190536a4f61888354e07dccaa501bd9a1c0f1c545533bde1650b.html mode change 100755 => 100644 benchmark/files/078cdb456d1beb698aeed86e0f2161e442e9431c4580295f1ba4ece22741068c.html mode change 100755 => 100644 benchmark/files/0a8c510c3691d8e68ccc749559680257a382fe792a3d4d8531fb285cd74c3492.html mode change 100755 => 100644 benchmark/files/0e55dcdbeb54c88ee87942b9fef7ea5398fa9a1e83493d55844b479506a80fd8.html mode change 100755 => 100644 benchmark/files/17ca85324662023ba21666b3ca5d5d37a92b2806bf7a88b906c28b90a635f82a.html mode change 100755 => 100644 benchmark/files/19fe8f574b7420277862728929d83dd74d7aa9c742688ca4c386b75693547bd3.html mode change 100755 => 100644 benchmark/files/1a2c2f9fe410c836bb94e85c85625dbe8174f6e57f0b0316644cefd30979f096.html mode change 100755 => 100644 benchmark/files/1bbc7f62e80e44afd533e896c0168c3b18f1e934530d05cb1f579ad3347d135c.html mode change 100755 => 100644 benchmark/files/1d43b4816bdba5825165dc21558d9eafb9f650c67ba048411b04dc77a745dc39.html mode change 100755 => 100644 benchmark/files/1de0efed4d661163ff8414e8ca69f45a49efd7edca19dc896ca0983a4bf41485.html mode change 100755 => 100644 benchmark/files/1e62a223bca12adda6410b1789072a2ad755566bd4a6bc17d10dc95a51d74d65.html mode change 100755 => 100644 benchmark/files/20f1955819dc2b50d2d10788f73adc72bceb491a03ed608debb72a90bce65c50.html mode change 100755 => 100644 benchmark/files/22c0f41ae560968de5e6b0ef9ecffffeae3f409aa73d9b82853f65535116f68f.html mode change 100755 => 100644 benchmark/files/22c3886e7116464c04c2332c20a013a5837992e7bcdb1f6cacd7d475f9784273.html mode change 100755 => 100644 benchmark/files/22c4be85802e9602a344fc2cc704093362b9193523c6e35cfb7dc086c8ef8648.html mode change 100755 => 100644 benchmark/files/26c3b98f33bb6902f32535235fd7d32792df87779bdf1f86c3b21e15fbf3161d.html mode change 100755 => 100644 benchmark/files/2dbf7cd4444617cc60f0e2d2c95b20a535979a32972f5005e2af577b37980e48.html mode change 100755 => 100644 benchmark/files/2fd71e2969106342bab6862bb212ae16ba592b426dd4141da8a383b183aa3a37.html mode change 100755 => 100644 benchmark/files/35f536ef8c8eba0616f2dc78e6653e1d7d68e3af927b09efad3dae7ce2080567.html mode change 100755 => 100644 benchmark/files/3b27831099c75b36d5978864ec89575c675c963e949cda52147a044bbfa77559.html mode change 100755 => 100644 benchmark/files/3f6413c32bffc73b64cb1a2adb237cd19ffc75494c9172755f1a961ba32e75dd.html mode change 100755 => 100644 benchmark/files/40d4e50472a8f0d30d68613051be510ed098087679df7e0e564d6dd32152d679.html mode change 100755 => 100644 benchmark/files/42b43887c6dd91353249924745e030eac3a6d818966d91c67b406431ff9bdf05.html mode change 100755 => 100644 benchmark/files/44b21071ae6feede3c36d2ab032cd422eb0c6a0fdfe4da79531931ad93dd4940.html mode change 100755 => 100644 benchmark/files/44f750fab67bb9f54f5b5cc90bc34d55cff06260a3e63245856a6e57fcda5906.html mode change 100755 => 100644 benchmark/files/45b6063ac2016db7b2fb1f995f0b54ee054fb561022e169c8fdbe321dcf672db.html mode change 100755 => 100644 benchmark/files/45efaba666da241d9d069b550890530b65f2a6b61a5e529e1d3664630d4897ee.html mode change 100755 => 100644 benchmark/files/46ab324348ca339dba58238e193f794c3309e52c018a8156ef9aedfedf0572e7.html mode change 100755 => 100644 benchmark/files/46ed10778ec7c1292e624e1a72a2a0899f8ab6d8d4db1aa57fa4418b8b7e0a5d.html mode change 100755 => 100644 benchmark/files/4b8debc51d3d9598ad4552cc7a591d200a6c7d545fed2454916bedbb0f666086.html mode change 100755 => 100644 benchmark/files/4bf8e536214f987f4a0bf6ca7d233619d30bde1e80a816c78d00358eb61e353c.html mode change 100755 => 100644 benchmark/files/4e0e399d24fe145def4817facccb0ff79e305dedb9ece5f8ec66396ea378f723.html mode change 100755 => 100644 benchmark/files/4f454cb97e9b77d94c10ed8a6a35cd2eff1671de9d3d27852a38abd76a95be83.html mode change 100755 => 100644 benchmark/files/4f83531b9fc91fd1e0062e43200669cd82cc36a518caa7f66fc6ba5be4ac545b.html mode change 100755 => 100644 benchmark/files/4fe5472ba89db38e20daef6025108310c52121fd382c06314d5b33d7f47c1e94.html mode change 100755 => 100644 benchmark/files/5a012f66c2bf0c70a0744c7483478aaa0c1a2b5b5920a72223f3a090e39df8be.html mode change 100755 => 100644 benchmark/files/5bc9df3a36efb57a22edf862cec6a28eb112e535559c194d7976fb664c922c13.html mode change 100755 => 100644 benchmark/files/5c83c2d71f97e2b5a979f197fbae6773dee6844e28889ae66ccb8d7458a9c5bb.html mode change 100755 => 100644 benchmark/files/5de3db78f95172797a51b3b3b2cdc4caeb63a4d7b709e4441510d2c1967e0e6f.html mode change 100755 => 100644 benchmark/files/5f081a0a9d1a1ce3b0e53603ecd8bde78947841c8fd1ff3c36efa95ee84681f6.html mode change 100755 => 100644 benchmark/files/5f8b89390d3fc01c6a80728ba2aee597fea1dbfc8399d61015956db71e5336c7.html mode change 100755 => 100644 benchmark/files/5f8c9f60be2250f694094ee1ca5deb9df10479e29fc92ff07c77c4cb9d2c3f21.html mode change 100755 => 100644 benchmark/files/5fbfe3905c71925b1b3a875a3111073e5d0996d3f250a697398477d3642db321.html mode change 100755 => 100644 benchmark/files/60b8aff17382f2fd02584645ef66e517b41f764d5b4ca404c1ceff3fe22bdda8.html mode change 100755 => 100644 benchmark/files/60bccec4069d54a6889bfcda785c0f3066a70cb5fadeea81f28d371681a2dee8.html mode change 100755 => 100644 benchmark/files/60cc80fb25f0b2ebdb2e6835ab7bfd3d26362971e39fe8838e7ac548ba323cf0.html mode change 100755 => 100644 benchmark/files/61adb9c208d9c67253b4413ef7ec2d010edae448b8c832bff2254125e4b51d5f.html mode change 100755 => 100644 benchmark/files/61d8052b19ed9885651ed1110ddcccc001f9ec2e3b7a77926d350762bcd02400.html mode change 100755 => 100644 benchmark/files/63c6d5256b8ce1098b5688eb5fafa747e9467692d099a3e9e42246e7af29748f.html mode change 100755 => 100644 benchmark/files/64bf40da8348d808ef103cc5529fd268fec46fbefa40b486d288d2a07871a527.html mode change 100755 => 100644 benchmark/files/6a59bd96489c98226c72f0245bac98a4b09aa0516ebfe4982233a6c33d129691.html mode change 100755 => 100644 benchmark/files/6b095375a53dfc7994a032e2efac70f43a4fac9303d549256d88b8f7cecadd50.html mode change 100755 => 100644 benchmark/files/6b817bedb8d6402bab160ed6d2b99256163bd3aef20deae3015f74e5bb253e55.html mode change 100755 => 100644 benchmark/files/6d30abed88489774017024b17cdb1928d9a2b45bb79767515383b8444e9601b2.html mode change 100755 => 100644 benchmark/files/71bf3c23c5d3fff9cec67606fde6547c8866ae8aa95f5991651d94c68df4ad1d.html mode change 100755 => 100644 benchmark/files/71cb773c42c94b75d41c059a27dd10b763443a71dbb6dd202402843de8a5e331.html mode change 100755 => 100644 benchmark/files/72e78dee157bdf3e8a9a9f07e54a98a3714ea2998e2c2e2a94c46dbe92176feb.html mode change 100755 => 100644 benchmark/files/72ecfb3f60f4e8a6103916f2041ce9a55c4ef1e31477f9a8ffb7f4d3bba8c559.html mode change 100755 => 100644 benchmark/files/73c175cdf9d5e065351ecf2220510088904adb77b49211cdd99e43e5870e06c2.html mode change 100755 => 100644 benchmark/files/74e8bc94abea7c60f022d8d3f672f80e59e3e126735fae0b5ee5914ff2fce48e.html mode change 100755 => 100644 benchmark/files/7a426de207434e419a65eead0f4b46c8a479429d8429c36dc03b033d7e4891df.html mode change 100755 => 100644 benchmark/files/7b7ffca82db8f721d6e5a8e4e65e60885af5eee4b9f28beb6b8363bb70c820f9.html mode change 100755 => 100644 benchmark/files/7e26f2e426fef3c1a370382e7827ef2e530a2ff0c2cea7641ebb596a4a1b8008.html mode change 100755 => 100644 benchmark/files/7e2d19ccbb3b4029dddf26557555278babdac18bb78a742052fd946001c28e4e.html mode change 100755 => 100644 benchmark/files/7e54e701ac39a9046d6eeb0ae75d2138733b66b30b5211e7f3245dd6dc3ca36c.html mode change 100755 => 100644 benchmark/files/7e91eb56692c91312a3dc3e7b769a2916029ef3d9e431d056d5f548c0f771d16.html mode change 100755 => 100644 benchmark/files/7fc58a2d32d5b8d5fa9b918453a284acc71703ccfa0f0c89ec292b4245fd0521.html mode change 100755 => 100644 benchmark/files/81d304541f62a6aaf29494766718ab8e58e95a8e784613e75f106cdef17868d6.html mode change 100755 => 100644 benchmark/files/83c362b1373f55d45fdad0edee4d2885cafd0da3f2afb146cf2822448c3c4104.html mode change 100755 => 100644 benchmark/files/84a7e7d5f61c90050a326bb74ac3a57899fdba4b755bd50df01a053c262d354e.html mode change 100755 => 100644 benchmark/files/8a1eb64f950f2f43097577c244fb38a35660f50a88c4305b23a8f24f254da8cb.html mode change 100755 => 100644 benchmark/files/8a701b6ec1c56e2c37357030da0b4b10af4187f069a988e12c2f91d2ba40cdc1.html mode change 100755 => 100644 benchmark/files/8a82ce22fec5e3656dad3d55e585727c88c94808ad92e37a0f6e99dcb3888800.html mode change 100755 => 100644 benchmark/files/8a9d17a1e5b1866abc7b9263fabbc428e5299c7443ecad6cc56c0076287fe11a.html mode change 100755 => 100644 benchmark/files/8bd6d9bcba689408767f770d69f12b59c3f092e73cffcc9332261fbab4aa16e1.html mode change 100755 => 100644 benchmark/files/8c0dd0456453aeff3f66d053710f18adc1a2fc0f1f3a0c95a3e166e41ffb737d.html mode change 100755 => 100644 benchmark/files/8c1a780dec8c1a5ea0344514524f53b2b580ce87083e0a756ade3d83627d5653.html mode change 100755 => 100644 benchmark/files/8cbf3b144736ffc4adda5fe7105e7fd1413dcc1955110829d849a658aa722bea.html mode change 100755 => 100644 benchmark/files/8cfa9d30e2b66b991461423012906121661cd9c8809f564eabb660149577864d.html mode change 100755 => 100644 benchmark/files/8d612a03fa42a2fb014b59534c46c9590da90fbeb91ac50938cdfa36dd274e23.html mode change 100755 => 100644 benchmark/files/8faa3156452fa9d0667617c406eb9b6458b48d7b8c36cf2bf804fba290b302f5.html mode change 100755 => 100644 benchmark/files/9c947bc9fbcb4e2eb0296d858fe193f580e869db7869358af822d7d2d4c0388e.html mode change 100755 => 100644 benchmark/files/9e04cb267a9b128369a11c7f6e5486d43644955dee7f73cc004b9cf1693a11c1.html mode change 100755 => 100644 benchmark/files/9e3c6d40690c1302613f203db178b23f9f18494d2653a1b547086a3973fff93c.html mode change 100755 => 100644 benchmark/files/9f2031ee45a11919452ca2efbc3498672324cda5f76314d7ea10913f63cf3545.html mode change 100755 => 100644 benchmark/files/9fba51a14308353194c537f494ded0ccb27d9f908f252690b083d48db64ea15a.html mode change 100755 => 100644 benchmark/index.js mode change 100755 => 100644 benchmark/package.json mode change 100755 => 100644 benchmark/wrapper/node-html-makrdown_reuse.js mode change 100755 => 100644 benchmark/wrapper/node-html-markdown.js mode change 100755 => 100644 benchmark/wrapper/turndown.js mode change 100755 => 100644 benchmark/wrapper/turndown_reuse.js mode change 100755 => 100644 benchmark/yarn.lock mode change 100755 => 100644 jest.config.js mode change 100755 => 100644 package.json mode change 100755 => 100644 src/config.ts mode change 100755 => 100644 src/index.ts mode change 100755 => 100644 src/main.ts mode change 100755 => 100644 src/nodes.ts mode change 100755 => 100644 src/options.ts mode change 100755 => 100644 src/translator.ts mode change 100755 => 100644 src/utilities.ts mode change 100755 => 100644 src/visitor.ts mode change 100755 => 100644 test/default-tags-codeblock.test.ts mode change 100755 => 100644 test/default-tags.test.ts mode change 100755 => 100644 test/special-cases.test.ts create mode 100644 test/table.test.ts mode change 100755 => 100644 test/tsconfig.json mode change 100755 => 100644 transformer.js mode change 100755 => 100644 tsconfig.base.json mode change 100755 => 100644 tsconfig.json mode change 100755 => 100644 yarn.lock diff --git a/.editorconfig b/.editorconfig old mode 100755 new mode 100644 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.idea/.name b/.idea/.name old mode 100755 new mode 100644 diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml old mode 100755 new mode 100644 diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml old mode 100755 new mode 100644 diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml old mode 100755 new mode 100644 diff --git a/.idea/modules.xml b/.idea/modules.xml old mode 100755 new mode 100644 diff --git a/.idea/node-html-markdown.iml b/.idea/node-html-markdown.iml old mode 100755 new mode 100644 diff --git a/.idea/vcs.xml b/.idea/vcs.xml old mode 100755 new mode 100644 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/benchmark/LICENSE.md b/benchmark/LICENSE.md old mode 100755 new mode 100644 diff --git a/benchmark/README.md b/benchmark/README.md old mode 100755 new mode 100644 diff --git a/benchmark/_run.js b/benchmark/_run.js old mode 100755 new mode 100644 diff --git a/benchmark/execute.js b/benchmark/execute.js old mode 100755 new mode 100644 diff --git a/benchmark/files/039c4b966d1f2a0c589ac0aad211fe65500ad1cb58c7f45b34251db7056803ec.html b/benchmark/files/039c4b966d1f2a0c589ac0aad211fe65500ad1cb58c7f45b34251db7056803ec.html old mode 100755 new mode 100644 diff --git a/benchmark/files/06ed0a833361190536a4f61888354e07dccaa501bd9a1c0f1c545533bde1650b.html b/benchmark/files/06ed0a833361190536a4f61888354e07dccaa501bd9a1c0f1c545533bde1650b.html old mode 100755 new mode 100644 diff --git a/benchmark/files/078cdb456d1beb698aeed86e0f2161e442e9431c4580295f1ba4ece22741068c.html b/benchmark/files/078cdb456d1beb698aeed86e0f2161e442e9431c4580295f1ba4ece22741068c.html old mode 100755 new mode 100644 diff --git a/benchmark/files/0a8c510c3691d8e68ccc749559680257a382fe792a3d4d8531fb285cd74c3492.html b/benchmark/files/0a8c510c3691d8e68ccc749559680257a382fe792a3d4d8531fb285cd74c3492.html old mode 100755 new mode 100644 diff --git a/benchmark/files/0e55dcdbeb54c88ee87942b9fef7ea5398fa9a1e83493d55844b479506a80fd8.html b/benchmark/files/0e55dcdbeb54c88ee87942b9fef7ea5398fa9a1e83493d55844b479506a80fd8.html old mode 100755 new mode 100644 diff --git a/benchmark/files/17ca85324662023ba21666b3ca5d5d37a92b2806bf7a88b906c28b90a635f82a.html b/benchmark/files/17ca85324662023ba21666b3ca5d5d37a92b2806bf7a88b906c28b90a635f82a.html old mode 100755 new mode 100644 diff --git a/benchmark/files/19fe8f574b7420277862728929d83dd74d7aa9c742688ca4c386b75693547bd3.html b/benchmark/files/19fe8f574b7420277862728929d83dd74d7aa9c742688ca4c386b75693547bd3.html old mode 100755 new mode 100644 diff --git a/benchmark/files/1a2c2f9fe410c836bb94e85c85625dbe8174f6e57f0b0316644cefd30979f096.html b/benchmark/files/1a2c2f9fe410c836bb94e85c85625dbe8174f6e57f0b0316644cefd30979f096.html old mode 100755 new mode 100644 diff --git a/benchmark/files/1bbc7f62e80e44afd533e896c0168c3b18f1e934530d05cb1f579ad3347d135c.html b/benchmark/files/1bbc7f62e80e44afd533e896c0168c3b18f1e934530d05cb1f579ad3347d135c.html old mode 100755 new mode 100644 diff --git a/benchmark/files/1d43b4816bdba5825165dc21558d9eafb9f650c67ba048411b04dc77a745dc39.html b/benchmark/files/1d43b4816bdba5825165dc21558d9eafb9f650c67ba048411b04dc77a745dc39.html old mode 100755 new mode 100644 diff --git a/benchmark/files/1de0efed4d661163ff8414e8ca69f45a49efd7edca19dc896ca0983a4bf41485.html b/benchmark/files/1de0efed4d661163ff8414e8ca69f45a49efd7edca19dc896ca0983a4bf41485.html old mode 100755 new mode 100644 diff --git a/benchmark/files/1e62a223bca12adda6410b1789072a2ad755566bd4a6bc17d10dc95a51d74d65.html b/benchmark/files/1e62a223bca12adda6410b1789072a2ad755566bd4a6bc17d10dc95a51d74d65.html old mode 100755 new mode 100644 diff --git a/benchmark/files/20f1955819dc2b50d2d10788f73adc72bceb491a03ed608debb72a90bce65c50.html b/benchmark/files/20f1955819dc2b50d2d10788f73adc72bceb491a03ed608debb72a90bce65c50.html old mode 100755 new mode 100644 diff --git a/benchmark/files/22c0f41ae560968de5e6b0ef9ecffffeae3f409aa73d9b82853f65535116f68f.html b/benchmark/files/22c0f41ae560968de5e6b0ef9ecffffeae3f409aa73d9b82853f65535116f68f.html old mode 100755 new mode 100644 diff --git a/benchmark/files/22c3886e7116464c04c2332c20a013a5837992e7bcdb1f6cacd7d475f9784273.html b/benchmark/files/22c3886e7116464c04c2332c20a013a5837992e7bcdb1f6cacd7d475f9784273.html old mode 100755 new mode 100644 diff --git a/benchmark/files/22c4be85802e9602a344fc2cc704093362b9193523c6e35cfb7dc086c8ef8648.html b/benchmark/files/22c4be85802e9602a344fc2cc704093362b9193523c6e35cfb7dc086c8ef8648.html old mode 100755 new mode 100644 diff --git a/benchmark/files/26c3b98f33bb6902f32535235fd7d32792df87779bdf1f86c3b21e15fbf3161d.html b/benchmark/files/26c3b98f33bb6902f32535235fd7d32792df87779bdf1f86c3b21e15fbf3161d.html old mode 100755 new mode 100644 diff --git a/benchmark/files/2dbf7cd4444617cc60f0e2d2c95b20a535979a32972f5005e2af577b37980e48.html b/benchmark/files/2dbf7cd4444617cc60f0e2d2c95b20a535979a32972f5005e2af577b37980e48.html old mode 100755 new mode 100644 diff --git a/benchmark/files/2fd71e2969106342bab6862bb212ae16ba592b426dd4141da8a383b183aa3a37.html b/benchmark/files/2fd71e2969106342bab6862bb212ae16ba592b426dd4141da8a383b183aa3a37.html old mode 100755 new mode 100644 diff --git a/benchmark/files/35f536ef8c8eba0616f2dc78e6653e1d7d68e3af927b09efad3dae7ce2080567.html b/benchmark/files/35f536ef8c8eba0616f2dc78e6653e1d7d68e3af927b09efad3dae7ce2080567.html old mode 100755 new mode 100644 diff --git a/benchmark/files/3b27831099c75b36d5978864ec89575c675c963e949cda52147a044bbfa77559.html b/benchmark/files/3b27831099c75b36d5978864ec89575c675c963e949cda52147a044bbfa77559.html old mode 100755 new mode 100644 diff --git a/benchmark/files/3f6413c32bffc73b64cb1a2adb237cd19ffc75494c9172755f1a961ba32e75dd.html b/benchmark/files/3f6413c32bffc73b64cb1a2adb237cd19ffc75494c9172755f1a961ba32e75dd.html old mode 100755 new mode 100644 diff --git a/benchmark/files/40d4e50472a8f0d30d68613051be510ed098087679df7e0e564d6dd32152d679.html b/benchmark/files/40d4e50472a8f0d30d68613051be510ed098087679df7e0e564d6dd32152d679.html old mode 100755 new mode 100644 diff --git a/benchmark/files/42b43887c6dd91353249924745e030eac3a6d818966d91c67b406431ff9bdf05.html b/benchmark/files/42b43887c6dd91353249924745e030eac3a6d818966d91c67b406431ff9bdf05.html old mode 100755 new mode 100644 diff --git a/benchmark/files/44b21071ae6feede3c36d2ab032cd422eb0c6a0fdfe4da79531931ad93dd4940.html b/benchmark/files/44b21071ae6feede3c36d2ab032cd422eb0c6a0fdfe4da79531931ad93dd4940.html old mode 100755 new mode 100644 diff --git a/benchmark/files/44f750fab67bb9f54f5b5cc90bc34d55cff06260a3e63245856a6e57fcda5906.html b/benchmark/files/44f750fab67bb9f54f5b5cc90bc34d55cff06260a3e63245856a6e57fcda5906.html old mode 100755 new mode 100644 diff --git a/benchmark/files/45b6063ac2016db7b2fb1f995f0b54ee054fb561022e169c8fdbe321dcf672db.html b/benchmark/files/45b6063ac2016db7b2fb1f995f0b54ee054fb561022e169c8fdbe321dcf672db.html old mode 100755 new mode 100644 diff --git a/benchmark/files/45efaba666da241d9d069b550890530b65f2a6b61a5e529e1d3664630d4897ee.html b/benchmark/files/45efaba666da241d9d069b550890530b65f2a6b61a5e529e1d3664630d4897ee.html old mode 100755 new mode 100644 diff --git a/benchmark/files/46ab324348ca339dba58238e193f794c3309e52c018a8156ef9aedfedf0572e7.html b/benchmark/files/46ab324348ca339dba58238e193f794c3309e52c018a8156ef9aedfedf0572e7.html old mode 100755 new mode 100644 diff --git a/benchmark/files/46ed10778ec7c1292e624e1a72a2a0899f8ab6d8d4db1aa57fa4418b8b7e0a5d.html b/benchmark/files/46ed10778ec7c1292e624e1a72a2a0899f8ab6d8d4db1aa57fa4418b8b7e0a5d.html old mode 100755 new mode 100644 diff --git a/benchmark/files/4b8debc51d3d9598ad4552cc7a591d200a6c7d545fed2454916bedbb0f666086.html b/benchmark/files/4b8debc51d3d9598ad4552cc7a591d200a6c7d545fed2454916bedbb0f666086.html old mode 100755 new mode 100644 diff --git a/benchmark/files/4bf8e536214f987f4a0bf6ca7d233619d30bde1e80a816c78d00358eb61e353c.html b/benchmark/files/4bf8e536214f987f4a0bf6ca7d233619d30bde1e80a816c78d00358eb61e353c.html old mode 100755 new mode 100644 diff --git a/benchmark/files/4e0e399d24fe145def4817facccb0ff79e305dedb9ece5f8ec66396ea378f723.html b/benchmark/files/4e0e399d24fe145def4817facccb0ff79e305dedb9ece5f8ec66396ea378f723.html old mode 100755 new mode 100644 diff --git a/benchmark/files/4f454cb97e9b77d94c10ed8a6a35cd2eff1671de9d3d27852a38abd76a95be83.html b/benchmark/files/4f454cb97e9b77d94c10ed8a6a35cd2eff1671de9d3d27852a38abd76a95be83.html old mode 100755 new mode 100644 diff --git a/benchmark/files/4f83531b9fc91fd1e0062e43200669cd82cc36a518caa7f66fc6ba5be4ac545b.html b/benchmark/files/4f83531b9fc91fd1e0062e43200669cd82cc36a518caa7f66fc6ba5be4ac545b.html old mode 100755 new mode 100644 diff --git a/benchmark/files/4fe5472ba89db38e20daef6025108310c52121fd382c06314d5b33d7f47c1e94.html b/benchmark/files/4fe5472ba89db38e20daef6025108310c52121fd382c06314d5b33d7f47c1e94.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5a012f66c2bf0c70a0744c7483478aaa0c1a2b5b5920a72223f3a090e39df8be.html b/benchmark/files/5a012f66c2bf0c70a0744c7483478aaa0c1a2b5b5920a72223f3a090e39df8be.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5bc9df3a36efb57a22edf862cec6a28eb112e535559c194d7976fb664c922c13.html b/benchmark/files/5bc9df3a36efb57a22edf862cec6a28eb112e535559c194d7976fb664c922c13.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5c83c2d71f97e2b5a979f197fbae6773dee6844e28889ae66ccb8d7458a9c5bb.html b/benchmark/files/5c83c2d71f97e2b5a979f197fbae6773dee6844e28889ae66ccb8d7458a9c5bb.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5de3db78f95172797a51b3b3b2cdc4caeb63a4d7b709e4441510d2c1967e0e6f.html b/benchmark/files/5de3db78f95172797a51b3b3b2cdc4caeb63a4d7b709e4441510d2c1967e0e6f.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5f081a0a9d1a1ce3b0e53603ecd8bde78947841c8fd1ff3c36efa95ee84681f6.html b/benchmark/files/5f081a0a9d1a1ce3b0e53603ecd8bde78947841c8fd1ff3c36efa95ee84681f6.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5f8b89390d3fc01c6a80728ba2aee597fea1dbfc8399d61015956db71e5336c7.html b/benchmark/files/5f8b89390d3fc01c6a80728ba2aee597fea1dbfc8399d61015956db71e5336c7.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5f8c9f60be2250f694094ee1ca5deb9df10479e29fc92ff07c77c4cb9d2c3f21.html b/benchmark/files/5f8c9f60be2250f694094ee1ca5deb9df10479e29fc92ff07c77c4cb9d2c3f21.html old mode 100755 new mode 100644 diff --git a/benchmark/files/5fbfe3905c71925b1b3a875a3111073e5d0996d3f250a697398477d3642db321.html b/benchmark/files/5fbfe3905c71925b1b3a875a3111073e5d0996d3f250a697398477d3642db321.html old mode 100755 new mode 100644 diff --git a/benchmark/files/60b8aff17382f2fd02584645ef66e517b41f764d5b4ca404c1ceff3fe22bdda8.html b/benchmark/files/60b8aff17382f2fd02584645ef66e517b41f764d5b4ca404c1ceff3fe22bdda8.html old mode 100755 new mode 100644 diff --git a/benchmark/files/60bccec4069d54a6889bfcda785c0f3066a70cb5fadeea81f28d371681a2dee8.html b/benchmark/files/60bccec4069d54a6889bfcda785c0f3066a70cb5fadeea81f28d371681a2dee8.html old mode 100755 new mode 100644 diff --git a/benchmark/files/60cc80fb25f0b2ebdb2e6835ab7bfd3d26362971e39fe8838e7ac548ba323cf0.html b/benchmark/files/60cc80fb25f0b2ebdb2e6835ab7bfd3d26362971e39fe8838e7ac548ba323cf0.html old mode 100755 new mode 100644 diff --git a/benchmark/files/61adb9c208d9c67253b4413ef7ec2d010edae448b8c832bff2254125e4b51d5f.html b/benchmark/files/61adb9c208d9c67253b4413ef7ec2d010edae448b8c832bff2254125e4b51d5f.html old mode 100755 new mode 100644 diff --git a/benchmark/files/61d8052b19ed9885651ed1110ddcccc001f9ec2e3b7a77926d350762bcd02400.html b/benchmark/files/61d8052b19ed9885651ed1110ddcccc001f9ec2e3b7a77926d350762bcd02400.html old mode 100755 new mode 100644 diff --git a/benchmark/files/63c6d5256b8ce1098b5688eb5fafa747e9467692d099a3e9e42246e7af29748f.html b/benchmark/files/63c6d5256b8ce1098b5688eb5fafa747e9467692d099a3e9e42246e7af29748f.html old mode 100755 new mode 100644 diff --git a/benchmark/files/64bf40da8348d808ef103cc5529fd268fec46fbefa40b486d288d2a07871a527.html b/benchmark/files/64bf40da8348d808ef103cc5529fd268fec46fbefa40b486d288d2a07871a527.html old mode 100755 new mode 100644 diff --git a/benchmark/files/6a59bd96489c98226c72f0245bac98a4b09aa0516ebfe4982233a6c33d129691.html b/benchmark/files/6a59bd96489c98226c72f0245bac98a4b09aa0516ebfe4982233a6c33d129691.html old mode 100755 new mode 100644 diff --git a/benchmark/files/6b095375a53dfc7994a032e2efac70f43a4fac9303d549256d88b8f7cecadd50.html b/benchmark/files/6b095375a53dfc7994a032e2efac70f43a4fac9303d549256d88b8f7cecadd50.html old mode 100755 new mode 100644 diff --git a/benchmark/files/6b817bedb8d6402bab160ed6d2b99256163bd3aef20deae3015f74e5bb253e55.html b/benchmark/files/6b817bedb8d6402bab160ed6d2b99256163bd3aef20deae3015f74e5bb253e55.html old mode 100755 new mode 100644 diff --git a/benchmark/files/6d30abed88489774017024b17cdb1928d9a2b45bb79767515383b8444e9601b2.html b/benchmark/files/6d30abed88489774017024b17cdb1928d9a2b45bb79767515383b8444e9601b2.html old mode 100755 new mode 100644 diff --git a/benchmark/files/71bf3c23c5d3fff9cec67606fde6547c8866ae8aa95f5991651d94c68df4ad1d.html b/benchmark/files/71bf3c23c5d3fff9cec67606fde6547c8866ae8aa95f5991651d94c68df4ad1d.html old mode 100755 new mode 100644 diff --git a/benchmark/files/71cb773c42c94b75d41c059a27dd10b763443a71dbb6dd202402843de8a5e331.html b/benchmark/files/71cb773c42c94b75d41c059a27dd10b763443a71dbb6dd202402843de8a5e331.html old mode 100755 new mode 100644 diff --git a/benchmark/files/72e78dee157bdf3e8a9a9f07e54a98a3714ea2998e2c2e2a94c46dbe92176feb.html b/benchmark/files/72e78dee157bdf3e8a9a9f07e54a98a3714ea2998e2c2e2a94c46dbe92176feb.html old mode 100755 new mode 100644 diff --git a/benchmark/files/72ecfb3f60f4e8a6103916f2041ce9a55c4ef1e31477f9a8ffb7f4d3bba8c559.html b/benchmark/files/72ecfb3f60f4e8a6103916f2041ce9a55c4ef1e31477f9a8ffb7f4d3bba8c559.html old mode 100755 new mode 100644 diff --git a/benchmark/files/73c175cdf9d5e065351ecf2220510088904adb77b49211cdd99e43e5870e06c2.html b/benchmark/files/73c175cdf9d5e065351ecf2220510088904adb77b49211cdd99e43e5870e06c2.html old mode 100755 new mode 100644 diff --git a/benchmark/files/74e8bc94abea7c60f022d8d3f672f80e59e3e126735fae0b5ee5914ff2fce48e.html b/benchmark/files/74e8bc94abea7c60f022d8d3f672f80e59e3e126735fae0b5ee5914ff2fce48e.html old mode 100755 new mode 100644 diff --git a/benchmark/files/7a426de207434e419a65eead0f4b46c8a479429d8429c36dc03b033d7e4891df.html b/benchmark/files/7a426de207434e419a65eead0f4b46c8a479429d8429c36dc03b033d7e4891df.html old mode 100755 new mode 100644 diff --git a/benchmark/files/7b7ffca82db8f721d6e5a8e4e65e60885af5eee4b9f28beb6b8363bb70c820f9.html b/benchmark/files/7b7ffca82db8f721d6e5a8e4e65e60885af5eee4b9f28beb6b8363bb70c820f9.html old mode 100755 new mode 100644 diff --git a/benchmark/files/7e26f2e426fef3c1a370382e7827ef2e530a2ff0c2cea7641ebb596a4a1b8008.html b/benchmark/files/7e26f2e426fef3c1a370382e7827ef2e530a2ff0c2cea7641ebb596a4a1b8008.html old mode 100755 new mode 100644 diff --git a/benchmark/files/7e2d19ccbb3b4029dddf26557555278babdac18bb78a742052fd946001c28e4e.html b/benchmark/files/7e2d19ccbb3b4029dddf26557555278babdac18bb78a742052fd946001c28e4e.html old mode 100755 new mode 100644 diff --git a/benchmark/files/7e54e701ac39a9046d6eeb0ae75d2138733b66b30b5211e7f3245dd6dc3ca36c.html b/benchmark/files/7e54e701ac39a9046d6eeb0ae75d2138733b66b30b5211e7f3245dd6dc3ca36c.html old mode 100755 new mode 100644 diff --git a/benchmark/files/7e91eb56692c91312a3dc3e7b769a2916029ef3d9e431d056d5f548c0f771d16.html b/benchmark/files/7e91eb56692c91312a3dc3e7b769a2916029ef3d9e431d056d5f548c0f771d16.html old mode 100755 new mode 100644 diff --git a/benchmark/files/7fc58a2d32d5b8d5fa9b918453a284acc71703ccfa0f0c89ec292b4245fd0521.html b/benchmark/files/7fc58a2d32d5b8d5fa9b918453a284acc71703ccfa0f0c89ec292b4245fd0521.html old mode 100755 new mode 100644 diff --git a/benchmark/files/81d304541f62a6aaf29494766718ab8e58e95a8e784613e75f106cdef17868d6.html b/benchmark/files/81d304541f62a6aaf29494766718ab8e58e95a8e784613e75f106cdef17868d6.html old mode 100755 new mode 100644 diff --git a/benchmark/files/83c362b1373f55d45fdad0edee4d2885cafd0da3f2afb146cf2822448c3c4104.html b/benchmark/files/83c362b1373f55d45fdad0edee4d2885cafd0da3f2afb146cf2822448c3c4104.html old mode 100755 new mode 100644 diff --git a/benchmark/files/84a7e7d5f61c90050a326bb74ac3a57899fdba4b755bd50df01a053c262d354e.html b/benchmark/files/84a7e7d5f61c90050a326bb74ac3a57899fdba4b755bd50df01a053c262d354e.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8a1eb64f950f2f43097577c244fb38a35660f50a88c4305b23a8f24f254da8cb.html b/benchmark/files/8a1eb64f950f2f43097577c244fb38a35660f50a88c4305b23a8f24f254da8cb.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8a701b6ec1c56e2c37357030da0b4b10af4187f069a988e12c2f91d2ba40cdc1.html b/benchmark/files/8a701b6ec1c56e2c37357030da0b4b10af4187f069a988e12c2f91d2ba40cdc1.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8a82ce22fec5e3656dad3d55e585727c88c94808ad92e37a0f6e99dcb3888800.html b/benchmark/files/8a82ce22fec5e3656dad3d55e585727c88c94808ad92e37a0f6e99dcb3888800.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8a9d17a1e5b1866abc7b9263fabbc428e5299c7443ecad6cc56c0076287fe11a.html b/benchmark/files/8a9d17a1e5b1866abc7b9263fabbc428e5299c7443ecad6cc56c0076287fe11a.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8bd6d9bcba689408767f770d69f12b59c3f092e73cffcc9332261fbab4aa16e1.html b/benchmark/files/8bd6d9bcba689408767f770d69f12b59c3f092e73cffcc9332261fbab4aa16e1.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8c0dd0456453aeff3f66d053710f18adc1a2fc0f1f3a0c95a3e166e41ffb737d.html b/benchmark/files/8c0dd0456453aeff3f66d053710f18adc1a2fc0f1f3a0c95a3e166e41ffb737d.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8c1a780dec8c1a5ea0344514524f53b2b580ce87083e0a756ade3d83627d5653.html b/benchmark/files/8c1a780dec8c1a5ea0344514524f53b2b580ce87083e0a756ade3d83627d5653.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8cbf3b144736ffc4adda5fe7105e7fd1413dcc1955110829d849a658aa722bea.html b/benchmark/files/8cbf3b144736ffc4adda5fe7105e7fd1413dcc1955110829d849a658aa722bea.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8cfa9d30e2b66b991461423012906121661cd9c8809f564eabb660149577864d.html b/benchmark/files/8cfa9d30e2b66b991461423012906121661cd9c8809f564eabb660149577864d.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8d612a03fa42a2fb014b59534c46c9590da90fbeb91ac50938cdfa36dd274e23.html b/benchmark/files/8d612a03fa42a2fb014b59534c46c9590da90fbeb91ac50938cdfa36dd274e23.html old mode 100755 new mode 100644 diff --git a/benchmark/files/8faa3156452fa9d0667617c406eb9b6458b48d7b8c36cf2bf804fba290b302f5.html b/benchmark/files/8faa3156452fa9d0667617c406eb9b6458b48d7b8c36cf2bf804fba290b302f5.html old mode 100755 new mode 100644 diff --git a/benchmark/files/9c947bc9fbcb4e2eb0296d858fe193f580e869db7869358af822d7d2d4c0388e.html b/benchmark/files/9c947bc9fbcb4e2eb0296d858fe193f580e869db7869358af822d7d2d4c0388e.html old mode 100755 new mode 100644 diff --git a/benchmark/files/9e04cb267a9b128369a11c7f6e5486d43644955dee7f73cc004b9cf1693a11c1.html b/benchmark/files/9e04cb267a9b128369a11c7f6e5486d43644955dee7f73cc004b9cf1693a11c1.html old mode 100755 new mode 100644 diff --git a/benchmark/files/9e3c6d40690c1302613f203db178b23f9f18494d2653a1b547086a3973fff93c.html b/benchmark/files/9e3c6d40690c1302613f203db178b23f9f18494d2653a1b547086a3973fff93c.html old mode 100755 new mode 100644 diff --git a/benchmark/files/9f2031ee45a11919452ca2efbc3498672324cda5f76314d7ea10913f63cf3545.html b/benchmark/files/9f2031ee45a11919452ca2efbc3498672324cda5f76314d7ea10913f63cf3545.html old mode 100755 new mode 100644 diff --git a/benchmark/files/9fba51a14308353194c537f494ded0ccb27d9f908f252690b083d48db64ea15a.html b/benchmark/files/9fba51a14308353194c537f494ded0ccb27d9f908f252690b083d48db64ea15a.html old mode 100755 new mode 100644 diff --git a/benchmark/index.js b/benchmark/index.js old mode 100755 new mode 100644 diff --git a/benchmark/package.json b/benchmark/package.json old mode 100755 new mode 100644 diff --git a/benchmark/wrapper/node-html-makrdown_reuse.js b/benchmark/wrapper/node-html-makrdown_reuse.js old mode 100755 new mode 100644 diff --git a/benchmark/wrapper/node-html-markdown.js b/benchmark/wrapper/node-html-markdown.js old mode 100755 new mode 100644 diff --git a/benchmark/wrapper/turndown.js b/benchmark/wrapper/turndown.js old mode 100755 new mode 100644 diff --git a/benchmark/wrapper/turndown_reuse.js b/benchmark/wrapper/turndown_reuse.js old mode 100755 new mode 100644 diff --git a/benchmark/yarn.lock b/benchmark/yarn.lock old mode 100755 new mode 100644 diff --git a/jest.config.js b/jest.config.js old mode 100755 new mode 100644 diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/src/config.ts b/src/config.ts old mode 100755 new mode 100644 index e74c052..17c0663 --- a/src/config.ts +++ b/src/config.ts @@ -1,4 +1,4 @@ -import { isWhiteSpaceOnly, surround, tagSurround, trimNewLines } from './utilities'; +import { isWhiteSpaceOnly, splitSpecial, surround, tagSurround, trimNewLines } from './utilities'; import { PostProcessResult, TranslatorConfigObject } from './translator'; import { NodeHtmlMarkdownOptions } from './options'; import { Options as NodeHtmlParserOptions } from 'node-html-parser' @@ -182,6 +182,62 @@ export const defaultTranslators: TranslatorConfigObject = { } }, + /* Table */ + 'table': ({ visitor }) => ({ + surroundingNewlines: 2, + childTranslators: visitor.instance.tableTranslators, + overrideMetadata: true, + postprocess: ({ content, nodeMetadata, node }) => { + // Split and trim leading + trailing pipes + const rawRows = splitSpecial(content).map(({ text }) => text.replace(/^(?:\|\s+)?(.+)\s*\|\s*$/, '$1')); + + /* Get Row Data */ + const rows: string[][] = []; + let colWidth: number[] = []; + for (const row of rawRows) { + if (!row) continue; + + /* Track columns */ + const cols = row.split(' |').map((c, i) => { + c = c.trim(); + if (colWidth.length < i + 1 || colWidth[i] < c.length) colWidth[i] = c.length; + + return c; + }); + + rows.push(cols); + } + + if (rows.length < 1) return PostProcessResult.RemoveNode; + + /* Compose Table */ + const maxCols = colWidth.length; + + let res = ''; + const caption = nodeMetadata.get(node)!.tableMeta!.caption; + if (caption) res += caption + '\n'; + + rows.forEach((cols, rowNumber) => { + res += '| '; + + /* Add Columns */ + for (let i = 0; i < maxCols; i++) { + let c = (cols[i] ?? ''); + c += ' '.repeat(Math.max(0, (colWidth[i] - c.length))); // Pad to max length + + res += c + ' |' + (i < maxCols - 1 ? ' ' : ''); + } + + res += '\n'; + + // Add separator row + if (rowNumber === 0) res += '|' + colWidth.map(w => ' ' + '-'.repeat(w) + ' |').join('') + '\n' + }); + + return res; + } + }), + /* Link */ 'a': ({ node, options, visitor }) => { const href = node.getAttribute('href'); @@ -239,12 +295,64 @@ export const defaultTranslators: TranslatorConfigObject = { }, } +export const tableTranslatorConfig: TranslatorConfigObject = { + /* Table Caption */ + 'caption': ({ visitor }) => ({ + surroundingNewlines: false, + childTranslators: visitor.instance.tableCellTranslators, + overrideMetadata: true, + postprocess: ({ content, nodeMetadata, node }) => { + const caption = content.replace(/(?:\r?\n)+/g, ' ').trim(); + if (caption) nodeMetadata.get(node)!.tableMeta!.caption = '__' + caption + '__' + + return PostProcessResult.RemoveNode; + }, + }), + + /* Table row */ + 'tr': ({ visitor }) => ({ + surroundingNewlines: false, + childTranslators: visitor.instance.tableRowTranslators, + overrideMetadata: true, + postfix: '\n', + prefix: '| ', + postprocess: ({ content }) => !/ \|\s*$/.test(content) ? PostProcessResult.RemoveNode : content + }), + + /* Table cell, (header cell) */ + 'th,td': ({ visitor }) => ({ + surroundingNewlines: false, + childTranslators: visitor.instance.tableCellTranslators, // FIXME: Circular references should be avoided. + overrideMetadata: true, + prefix: ' ', + postfix: ' |', + postprocess: ({ content }) => + trimNewLines(content) + .replace('|', '\\|') + .replace(/(?:\r?\n)+/g, ' ') + .trim() + }), +} + +export const tableRowTranslatorConfig: TranslatorConfigObject = { + 'th,td': tableTranslatorConfig['th,td'] +} + +export const tableCellTranslatorConfig: TranslatorConfigObject = { + 'a': defaultTranslators['a'], + 'strong,b': defaultTranslators['strong,b'], + 'del,s,strike': defaultTranslators['del,s,strike'], + 'em,i': defaultTranslators['em,i'], + 'img': defaultTranslators['img'] +} + export const defaultCodeBlockTranslators: TranslatorConfigObject = { 'br': { content: `\n`, recurse: false }, 'hr': { content: '---', recurse: false }, 'h1,h2,h3,h4,h5,h6': { prefix: '[', postfix: ']' }, 'ol,ul': defaultTranslators['ol,ul'], 'li': defaultTranslators['li'], + 'tr': { surroundingNewlines: true }, 'img': { recurse: false } } diff --git a/src/index.ts b/src/index.ts old mode 100755 new mode 100644 diff --git a/src/main.ts b/src/main.ts old mode 100755 new mode 100644 index 1e1cb3f..1839f26 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,7 @@ import { NodeHtmlMarkdownOptions } from './options'; import { TranslatorCollection, TranslatorConfigObject } from './translator'; import { aTagTranslatorConfig, defaultBlockElements, defaultCodeBlockTranslators, defaultIgnoreElements, defaultOptions, - defaultTranslators + defaultTranslators, tableCellTranslatorConfig, tableRowTranslatorConfig, tableTranslatorConfig } from './config'; import { parseHTML } from './utilities'; import { getMarkdownForHtmlNodes } from './visitor'; @@ -26,6 +26,9 @@ export class NodeHtmlMarkdown { public translators = new TranslatorCollection(); public aTagTranslators = new TranslatorCollection(); public codeBlockTranslators = new TranslatorCollection(); + public tableTranslators = new TranslatorCollection(); + public tableRowTranslators = new TranslatorCollection(); + public tableCellTranslators = new TranslatorCollection(); public readonly options: NodeHtmlMarkdownOptions constructor(options?: Options, customTranslators?: TranslatorConfigObject, customCodeBlockTranslators?: TranslatorConfigObject) { @@ -55,12 +58,20 @@ export class NodeHtmlMarkdown { for (const [ elems, cfg ] of Object.entries(aTagTranslatorConfig)) this.aTagTranslators.set(elems, cfg, true); + for (const [ elems, cfg ] of Object.entries(tableTranslatorConfig)) + this.tableTranslators.set(elems, cfg, true); + + for (const [ elems, cfg ] of Object.entries(tableRowTranslatorConfig)) + this.tableRowTranslators.set(elems, cfg, true); + + for (const [ elems, cfg ] of Object.entries(tableCellTranslatorConfig)) + this.tableCellTranslators.set(elems, cfg, true); + // TODO - Workaround for upstream issue (may not be fixed) - https://github.com/taoqf/node-html-parser/issues/78 if (!this.options.textReplace) this.options.textReplace = []; this.options.textReplace.push([ /^/gmi, '' ]); } - /* ********************************************************* */ // region: Static Methods /* ********************************************************* */ diff --git a/src/nodes.ts b/src/nodes.ts old mode 100755 new mode 100644 diff --git a/src/options.ts b/src/options.ts old mode 100755 new mode 100644 diff --git a/src/translator.ts b/src/translator.ts old mode 100755 new mode 100644 index 460abce..444c563 --- a/src/translator.ts +++ b/src/translator.ts @@ -93,6 +93,11 @@ export interface TranslatorConfig { * Custom translator collection to use for child HTML nodes */ childTranslators?: TranslatorCollection + + /** + * Force overrite node metadata (for custom translators) + */ + overrideMetadata?: boolean } export enum PostProcessResult { diff --git a/src/utilities.ts b/src/utilities.ts old mode 100755 new mode 100644 diff --git a/src/visitor.ts b/src/visitor.ts old mode 100755 new mode 100644 index ccc27cf..6177edb --- a/src/visitor.ts +++ b/src/visitor.ts @@ -20,6 +20,10 @@ export interface NodeMetadata { noEscape?: boolean preserveWhitespace?: boolean translators?: TranslatorConfigObject + tableMeta?: { + node: ElementNode, + caption?: string + } } export type NodeMetadataMap = Map @@ -184,6 +188,13 @@ export class Visitor { preserveWhitespace: true } break; + case 'TABLE': + metadata = { + ...metadata, + tableMeta: { + node: node + } + } } if (metadata) this.nodeMetadata.set(node, metadata); @@ -205,7 +216,7 @@ export class Visitor { if (cfg.ignore) return; /* Update metadata if needed */ - if ((cfg.noEscape && !metadata?.noEscape) || (cfg.childTranslators && !metadata?.translators)) { + if ((cfg.noEscape && !metadata?.noEscape) || (cfg.childTranslators && (!metadata?.translators || cfg.overrideMetadata))) { metadata = { ...metadata, noEscape: cfg.noEscape, translators: cfg.childTranslators }; this.nodeMetadata.set(node, metadata); } diff --git a/test/default-tags-codeblock.test.ts b/test/default-tags-codeblock.test.ts old mode 100755 new mode 100644 index 30e20fb..41254d8 --- a/test/default-tags-codeblock.test.ts +++ b/test/default-tags-codeblock.test.ts @@ -77,4 +77,9 @@ describe(`Default Tags`, () => { expect(res).toBe(getExpected(` \n \n* a \nb\n \n \n* b \n \n * c \n d \n \n 1. e \n f\n \n `)); }); }); + + test(`Table`, () => { + const res = translateAsBlock('abc
X
'); + expect(res).toBe(getExpected(`a\nb\nc\n\nX\n\n`)); + }) }); diff --git a/test/default-tags.test.ts b/test/default-tags.test.ts old mode 100755 new mode 100644 diff --git a/test/special-cases.test.ts b/test/special-cases.test.ts old mode 100755 new mode 100644 diff --git a/test/table.test.ts b/test/table.test.ts new file mode 100644 index 0000000..9a4be5b --- /dev/null +++ b/test/table.test.ts @@ -0,0 +1,102 @@ +import { NodeHtmlMarkdown } from '../src'; + + +/* ****************************************************************************************************************** * + * Tests + * ****************************************************************************************************************** */ + +describe(`Table`, () => { + let instance: NodeHtmlMarkdown; + const translate = (html: string) => instance.translate(html); + beforeAll(() => { + instance = new NodeHtmlMarkdown(); + }); + + test(`Single row, Single column table`, () => { + const expected = `| col1 |\n| ---- |`; + + expect(translate(`
col1
`)).toBe(expected); + expect(translate(`
col1
`)).toBe(expected); + expect(translate(`
col1
`)).toBe(expected); + }); + + test(`Single row table`, () => { + const expected = `| col1 | col2 |\n| ---- | ---- |`; + + expect(translate(`
col1 col2
`)).toBe(expected); + expect(translate(`
col1 col2
`)).toBe(expected); + expect(translate(`
col1 col2
`)).toBe(expected); + }); + + test(`Table with caption`, () => { + const expected = + `__Hello__\n` + + `| col1 | col2 |\n` + + `| ---- | ---- |`; + + expect(translate(`
Hello
col1 col2
`)).toBe(expected); + expect(translate(`
col1 col2
Hello
`)).toBe(expected); + }); + + describe(`Special Cases`, () => { + test(`"|" is escaped`, () => { + expect(translate(`
A|B
`)).toBe(`| A\\|B |\n| ---- |`); + }); + + test(`Pads cells`, () => { + const html = ` + + + +
abcdefghi
abc1def123ghi1234567
adef1234c
`; + const expected = + `| abc | def | ghi |\n` + + `| ---- | ------- | ---------- |\n` + + `| abc1 | def123 | ghi1234567 |\n` + + `| a | def1234 | c |`; + + expect(translate(html)).toBe(expected); + }); + + test(`Nested tables are not supported`, () => { + const html = `
nested
abc
`; + expect(translate(html)).toBe(`| nested | abc |\n| ------ | --- |`); + }); + + test(`Supports inline tags + mismatched rows`, () => { + const html = ` + + + + + + + + + + + + + + + + + + + + +
COL1C + O + L2
bia
  • list

h1

+ `; + + const expected = + `| COL1 | C O L2 | | |\n` + + `| ----- | ------ | --------- | --------- |\n` + + `| **b** | _i_ | [a](link) | ![](file) |\n` + + `| list | | h1 | |`; + + expect(translate(html)).toBe(expected); + }); + }); +}); diff --git a/test/tsconfig.json b/test/tsconfig.json old mode 100755 new mode 100644 diff --git a/transformer.js b/transformer.js old mode 100755 new mode 100644 diff --git a/tsconfig.base.json b/tsconfig.base.json old mode 100755 new mode 100644 diff --git a/tsconfig.json b/tsconfig.json old mode 100755 new mode 100644 diff --git a/yarn.lock b/yarn.lock old mode 100755 new mode 100644