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

Nested script inside jsx tag is not parsed #1342

Closed
supnate opened this issue Mar 9, 2018 · 8 comments
Closed

Nested script inside jsx tag is not parsed #1342

supnate opened this issue Mar 9, 2018 · 8 comments

Comments

@supnate
Copy link

supnate commented Mar 9, 2018

<CodeView title={<span title={123}>2</span>}>for of as</CodeView>

image

@Golmote
Copy link
Contributor

Golmote commented Mar 9, 2018

Hi! Thanks for reporting.
I don't think we're gonna fix this one, though. Prism can't (at the moment anyway) handle infinitely deep recursions of patterns.

We might handle it at some point, but this is really not on agenda for the near future.

@Golmote Golmote closed this as completed Mar 9, 2018
@Golmote Golmote added the wontfix label Mar 9, 2018
@supnate
Copy link
Author

supnate commented Mar 9, 2018

That's fine. Thanks.

@Golmote
Copy link
Contributor

Golmote commented Mar 11, 2018

I reopen this issue, since it should actually be fixable.

@supnate
Copy link
Author

supnate commented Mar 13, 2018

Thanks @Golmote ! Can't wait to try it!

@Golmote Golmote reopened this Mar 13, 2018
@supnate
Copy link
Author

supnate commented Mar 13, 2018

By the way, just for your information, I'm using prismjs for syntax highlighting with Monaco Editor. See the live demo at: http://demo.rekit.org/element/src%2Ffeatures%2Fcommon%2Fmonaco%2Fworkers%2FsyntaxHighlighter.js/code . Did some job on finding jsx text elements.

@Golmote
Copy link
Contributor

Golmote commented Mar 13, 2018

I accidently closed the issue when #1345 was merged. But it was actually fixed in the next commit (cc80ccd). A test for this specific use case was added in f0e6249.

So it should be fixed now! 🎉

Note that we probably still won't be able to handle infinite recursion (since JS regexps are not recursive), but at least this use case is handled!

@Golmote
Copy link
Contributor

Golmote commented Mar 13, 2018

By the way, just for your information, I'm using prismjs for syntax highlighting with Monaco Editor. See the live demo at: http://demo.rekit.org/element/src%2Ffeatures%2Fcommon%2Fmonaco%2Fworkers%2FsyntaxHighlighter.js/code . Did some job on finding jsx text elements.

You mean to handle plain text (#1304 and #1294)? That's interesting! Unfortunately, this looks too complicated to be included in Prism like this... I'd love to find a lighter solution to this issue.

@supnate
Copy link
Author

supnate commented Mar 13, 2018

Yes exactly! Both for the problem and code complication.. Hope it would be resolved from prismjs side finally some day!

Thanks for your effort on making such a great tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants