Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(strip_html): remove striptags deps #232

Merged
merged 1 commit into from
Sep 20, 2020
Merged

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Sep 20, 2020

striptags is the most safe strip HTML lib (as it implements a AST parser instead of using regex).

However:

  • striptags implements a simple Symbol polyfill that Hexo doesn't need (we target latest Node.js LTS)
  • striptags supports stream and many other features (like tags whitelist) that Hexo doesn't need as well
  • In order to supports those features striptags introduce a bit performance drawback.

The PR re-implements the striptags without those unneeded features. The unit test cases are adopted from striptags.

@SukkaW SukkaW requested a review from a team September 20, 2020 14:17
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 97.661% when pulling 732602d on SukkaW:strip-html into 19315b8 on hexojs:master.

@SukkaW SukkaW merged commit 57f70d9 into hexojs:master Sep 20, 2020
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
nevilm-lt pushed a commit to nevilm-lt/hexo-util that referenced this pull request Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants