cloud-annotations / docusaurus-openapi

🦕 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.netlify.app
MIT License
498 stars 82 forks source link

Fix: Page crash on half surrogate pair #261

Closed jNullj closed 11 months ago

jNullj commented 1 year ago

This commit fixes an issue where utf-16 encoded surrogated pair could crash the page when inserted as input. The commit adds endsWithHalfSurrogatePair to check for half pair and safeEncodeURIComponent to ignore half surrogated pair before passing it to encodeURIComponent.

I replaced encodeURIComponent with safeEncodeURIComponent to solve the bug. I run lint, testing and and cypress and everything seems ok. I also tested before/after changes by hand to make sure the bug is solved.

Fixes #260

netlify[bot] commented 1 year ago

Deploy Preview for docusaurus-openapi ready!

Name Link
Latest commit 1073234ca9ed3336bda7cb0c397e1734997795f7
Latest deploy log https://app.netlify.com/sites/docusaurus-openapi/deploys/64fa0b3a2bd125000975916c
Deploy Preview https://deploy-preview-261--docusaurus-openapi.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

jNullj commented 11 months ago

Ping @bourdakos1