-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Scoping highlighting tags to the mocha element #1325
Conversation
I'm not sure whether I'm missing an edge case or not, but this solves my issue and it makes sense to me that this is what we would want it to be anyway. Everything should be scoped to the `#mocha` element anyway. My use case is I have a collection of components and I have tests for them. I have a site that shows the component, an example, and the test. The example and test is interactive and runs on the page. Without this change, mocha will highlight all my other code tags on the page which messes things up. Here's an example of this change working on my page: http://kent.doddsfamily.us/kcd-angular/#/kcd-dynamic-attr#spec (see the spec toward the bottom)
I'm actually kind of surprised this code exists at all. If the user wants syntax highlighting, it's trivial to apply highlight.js or whathaveyou. And assuredly a 3p module will do a better job than this wonky highlight function... I'd just as soon remove this functionality and let the user do what they want, instead of standing in their way (or at least allow the user to turn it off)... @kentcdodds Would you be interested in changing your PR to make the automatic highlighting optional? Would that solve your problem? |
@boneskull @kentcdodds I think both would make sense. Scoping it to To be honest, I feel that most of the functionality offered in |
I thought this code was for highlighting the test. So I don't see how it could be removed or made opt-in without a breaking change version bump. Maybe I'm wrong. But I don't know this codebase well... |
Scoping highlighting tags to the mocha element
👍 ⭐ |
Uh oh, Travis failed. I'd like to find someone who prefers the |
Transient failure, restarted the build and it's ok. |
A nice, explains why I couldn't reproduce it locally. |
I'm not sure whether I'm missing an edge case or not, but this solves my issue and it makes sense to me that this is what we would want it to be anyway. Everything should be scoped to the
#mocha
element anyway. My use case is I have a collection of components and I have tests for them. I have a site that shows the component, an example, and the test. The example and test is interactive and runs on the page. Without this change, mocha will highlight all my other code tags on the page which messes things up. Here's an example of this change working on my page: http://kent.doddsfamily.us/kcd-angular/#/kcd-dynamic-attr#spec (see the spec toward the bottom)