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

fix: added cyrillic symbols in regexp (#1980) #2154

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pihail
Copy link

@Pihail Pihail commented Apr 23, 2024

Description

Fix #1980

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

@@ -76,7 +76,7 @@ export const normalizeFileName = (name) => {
return name;
}

const validChars = /[^\w\s-]/g;
const validChars = /[^\w\s\u0430-\u044f-]/gi;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, this only adds Cyryllic to basic alphanumeric characters. That still leaves quite a number of characters in other scripts as well as diacritics in Latin, that should be accepted based on the same principle. On top of that I'd argue the \s excludes a few problematic variants of whitespace that should in fact be escaped.

My proposition is the following:
/[^\p{L}\p{N} \.-_]/gu
That is:

  • /gu for full unicode
  • \p{L} - any kind of letter from any script
  • \p{N} - any kind of numeric character in any script
  • \.-_ - a literal whitespace, a dot, a dash and an underscore

Would bruno support that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imporing OpenAPI specs with cyrrilic symbols doesn't work correctly
3 participants