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: handle TOC token as case insensitive #1288

Merged
merged 4 commits into from
Mar 20, 2019

Conversation

vikrantsinghthakur
Copy link
Contributor

Motivation

Fix #1234
Placeholder tokens going through crowdin get converted to lowercase. This PR tries to check for both uppercase and lowercase placeholder token to be replaced with table.

Have you read the Contributing Guidelines on pull requests?

YES

Test Plan

Use crowdin to generate translation and check if table of contents has been added correctly

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@yangshun
Copy link
Contributor

yangshun commented Mar 19, 2019

Deploy preview for munseo-preview ready!

Built with commit 163622d

https://deploy-preview-1288--munseo-preview.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Mar 19, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 163622d

https://deploy-preview-1288--docusaurus-preview.netlify.com

@vikrantsinghthakur
Copy link
Contributor Author

Well I see the generated netlify build itself has the issue, even without translation. Let me take a look into it.

@jakebolam
Copy link
Member

For sure @vikrantsinghthakur

@vikrantsinghthakur
Copy link
Contributor Author

There were 2 builds generated for the PR with the same commit, munseo-preview and docusaurus-preview.
Table of contents was not generated for the former, while it seems to be working fine for the latter. This looks like a non deterministic outcome and I wonder why it occurred. Can anyone with more information about this enlighten me?

@endiliey
Copy link
Contributor

Ignore the munseo-preview, thats the v2 build and lot of stuff is still wip on v2.

Sent with GitHawk

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

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

Instead of searching for the lower case version and the upper case version. We can do better with case insensitive search.

Regex allows this via “i” flag. Please refactor the code :)

@endiliey endiliey merged commit 79bbe8e into facebook:master Mar 20, 2019
@endiliey endiliey changed the title fix: check for lowercase TOC token fix: handle TOC token as case insensitive Mar 20, 2019
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.

None yet

6 participants