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

Failed to slug Arabic/RTL text #60

Open
montaro opened this issue Feb 10, 2016 · 2 comments
Open

Failed to slug Arabic/RTL text #60

montaro opened this issue Feb 10, 2016 · 2 comments

Comments

@montaro
Copy link

montaro commented Feb 10, 2016

  const text = 'لماذا نعيش؟';
  const print = console.log.bind(console, '>');
  print('text to slug: ', text);  // > لماذا نعيش؟
  print('text slugged: ', slug(text));  // > undefined
  print('text really slugged: ', slug(text, {lowercase: false}));    // > undefined
@dmaii
Copy link

dmaii commented Feb 14, 2016

This library won't parse those characters because they'er not a part of the So category of unicode characters. This library only parses characters from that category.

I ran into the same issue so I ended up creating my own fork, which handles your use case, since I wasn't sure what the author's intent was.

@montaro
Copy link
Author

montaro commented Feb 14, 2016

Thanks @suisha for your reply. Actually I in my case I did not like to have transliteration in URLs, so I overrided the slug generator function using this lib https://www.npmjs.com/package/arslugify and it worked for me with https://www.npmjs.com/package/mongoose-url-slugs

Thanks again!

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

No branches or pull requests

2 participants