-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
highlight not defined #375
Comments
Change:
To:
Change:
To:
Change:
To:
All of this is unnecessary though. If you provide a highlight callback, this is done for you. |
Your solution leaves me slightly confused: you mention that this is done by providing a highlight callback, however isn't that what this line of my code accomplishes?
|
Yep. All of the rest is unnecessary. |
Ok, but then why is this still a problem? |
My current initialization does the following:
the |
Hmm, I think you may have discovered an issue. The non-async highlighting should already prevent double escaping, but it looks like the switch to the renderer broke that. Fixing. |
Thanks! Works perfectly now |
Hmm, then again, this shouldn't really affect anything unless the tokens are handled after the |
Yeah, initially I tried it with just the highlight callback defined, but I ended up with the code blocks being escaped after they had been highlighted. I switch over to the fix suggested in issue #6, which solved the double escaping but led to this subtle bug in the highlight callback. With the code changes you made yesterday, I was able to remove the workaround suggested in issue #6 and everything worked as expected. |
I'm experiencing a subtle bug when using marked in conjunction with highlight.js. I am using your double-escaping workaround for code highlighting to great effect: optional escape #6, but when I attempt to begin a markdown string with code, as opposed to the other semantic tags, I get an
Uncaught ReferenceError: highlight is not defined
. Here is the code that I am using:As an example, the following markdown will be rendered properly, and without incident:
whereas this throws an error:
Any thoughts on what the problem might be here?
The text was updated successfully, but these errors were encountered: