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

Supports Chinese file name #17

Merged
merged 4 commits into from
Sep 5, 2020
Merged

Supports Chinese file name #17

merged 4 commits into from
Sep 5, 2020

Conversation

xiaojian-hong
Copy link
Contributor

Allow Chinese characters in isFileName function.

@yumauri
Copy link
Owner

yumauri commented Sep 4, 2020

Wow, thank you!

Did you try to send files with Chinese characters to Gotenberg? Does it work?

Also, maybe it will be better to use /^[\p{L}\w\s\(\),-]+\.[A-Za-z0-9]+$/u? To match any characters in any language possible.

@xiaojian-hong
Copy link
Contributor Author

Wow, thank you!

Did you try to send files with Chinese characters to Gotenberg? Does it work?

Also, maybe it will be better to use /^[\p{L}\w\s\(\),-]+\.[A-Za-z0-9]+$/u? To match any characters in any language possible.

Yes, I tested files with Chinese characters to Gotenberg, it works.
Your suggestion /^[\p{L}\w\s\(\),-]+\.[A-Za-z0-9]+$/u is even better.

xiaojian-hong and others added 2 commits September 5, 2020 18:22
@xiaojian-hong
Copy link
Contributor Author

xiaojian-hong commented Sep 5, 2020

Seems there is an issue in TSLint for unicode regexps. buzinas/tslint-eslint-rules#289
yarn lint throws ERROR: 85:20 no-empty-character-class don't use empty classes in regular expressions.
I just disabled the tslint rule no-empty-character-class in this regexp.

@yumauri
Copy link
Owner

yumauri commented Sep 5, 2020

I doubt TSLint will fix this, because it has been deprecated, so until I move to ESLint, I'm OK with this :) Thank you!

@yumauri yumauri merged commit 8ab8309 into yumauri:master Sep 5, 2020
@yumauri
Copy link
Owner

yumauri commented Sep 5, 2020

Released in version 0.6.2 🎉

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.

2 participants