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

Only lowercase tags are allowed to register #11

Open
CoenWarmer opened this issue May 30, 2018 · 0 comments
Open

Only lowercase tags are allowed to register #11

CoenWarmer opened this issue May 30, 2018 · 0 comments

Comments

@CoenWarmer
Copy link

When upgrading to React 16.4 we noticed some weird behavior. Tags that used to be recognized by the bbcode-to-react parser were suddenly being displayed as text.

After doing some research, we found out that when registering tags for the parser, the first argument passed needs to be all lowercase. Even if the tag in the content string that is passed is not all lowercase.

So, if you register your tag like this, the tag will be recognized by the parser:
parser.registerTag('centeredimage', ImageCenteredTag)

If you register your tag like this, the tag will not be recognized by the parser:
parser.registerTag('centeredImage', ImageCenteredTag)

Interestingly, it doesn't matter which content string you pass to the parser, both will work. So the content string can be [centeredimage] or [centeredImage].

This is not a huge issue, and everything works as expected, but I just wanted to report these findings so other users can take note.

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

1 participant