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

toc cound not handle Chinese #12

Open
hongjiev opened this issue Nov 21, 2017 · 3 comments
Open

toc cound not handle Chinese #12

hongjiev opened this issue Nov 21, 2017 · 3 comments

Comments

@hongjiev
Copy link

hongjiev commented Nov 21, 2017

this.slugify = function (text) {
     return text.toLowerCase().replace(/[^\w]+/g, '-');
}

The code above works fine with English, but it's not compatible with non-English post.

@making
Copy link
Owner

making commented Nov 21, 2017

Do you have any idea to support non-English?

@hongjiev
Copy link
Author

Sorry, I just found that you have provided the useful function enableHeadingIdUriEncoding(boolean) . The way is not elegant but useful.
Maybe you should consider not to replace non-English words with '-', modern browsers work fine with non-English anchors and url.
Btw, thanks for providing this tool, it's very nice.

@making
Copy link
Owner

making commented Nov 21, 2017

I just remembered that lol.

I think that enableHeadingIdUriEncoding is not perfect. This wouldn't work when title contains special characters such as ).

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