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

Prism throws strange lines of code #379

Closed
mallakas opened this issue Oct 6, 2014 · 12 comments
Closed

Prism throws strange lines of code #379

mallakas opened this issue Oct 6, 2014 · 12 comments

Comments

@mallakas
Copy link

mallakas commented Oct 6, 2014

I apology for the vague title, but I have a strange behavior when I right some python code, after I type some code in my blog (powered by Ghost and NodeJs) I see these lines that of course I didn't typed.

  • */ ",

I have to add also that this happens after a line that has an email inside, any help will be much appreciated.

@mallakas mallakas changed the title Prism throws a strange lines of code Prism throws strange lines of code Oct 6, 2014
@Gexos
Copy link

Gexos commented Oct 7, 2014

@mallakas I had the same issue too, it seems that prism doesn't like the @ sign, I managed to fix this by replacing the @ sign with this special HTML character @. Test it and see if it works for you.

@LeaVerou
Copy link
Member

LeaVerou commented Oct 7, 2014

Could you link to an online testcase? Is it reproducible in the test drive page? Which language definition is this about?

@mallakas
Copy link
Author

mallakas commented Oct 7, 2014

@Gexos , thank you your solution fixed my issue, it doesn't throw these lines anymore.
@LeaVerou , in the test drive page it works fine, the language I use is Python, on my Ghost blog which is powered by Nodejs I tried the standard markdown code and highlight.js and it worked fine, I believe is not a Ghost issue, here is an online testcase http://codepen.io/anon/pen/cFykp, it works fine there too, I can not understand why it happens only in me.

Thank you

@LeaVerou
Copy link
Member

LeaVerou commented Oct 7, 2014

Have you tried opening an issue with Ghost?

@mallakas
Copy link
Author

mallakas commented Oct 7, 2014

Well I post it there, but I answered my self with the solution @Gexos provided above. But I will open a new one in the bug section. I will let you know if I have a solution from there.

Thank you @LeaVerou

@reinink
Copy link

reinink commented Oct 9, 2014

Hi all, I think I figured out the issue to this problem. I believe this is being caused by Cloudflare's email protection. We had the same problem recently and I couldn't figure out why the exact same code didn't cause the same results on my local system. Looking at the source code, I noticed that a __cf_email__ class was being applied to the email address, which tipped me off, since we recently switched to Cloudflare for our DNS.

You can disable the e-mail address obfuscation in the Cloudflare control panel under "Security Settings".

screen shot 2014-10-09 at 11 27 20 am

Hope that helps!

@philsturgeon
Copy link

Ha! Nicely done @reinink.

@reinink
Copy link

reinink commented Oct 9, 2014

@philsturgeon Thanks ;)

Just an update for anyone else who arrives here, I've successfully disabled email address obfuscation in Cloudflare, and then forced a cache refresh, and now things are good. See this doc for more information on purging the cache.

@mallakas
Copy link
Author

mallakas commented Oct 9, 2014

well done @reinink , I'm using cloudflare too and I disabled email address obfuscation, and the code works fine, of course I do need the obfuscation too, so if cloudflare don't mess with anything else, I will just use the html code trick. I will post this solution at the Ghost forum also, since I opened an issue there.

Thank you!

@Gexos
Copy link

Gexos commented Oct 10, 2014

Brilliant @reinink , I feel bad now that I almost "blamed" Prism. :)

@apfelbox
Copy link
Contributor

apfelbox commented Nov 6, 2014

Great news, that you were able to resolve the issue.

@mallakas everything is working for you now? Can we close this issue?

@Golmote Golmote mentioned this issue Dec 13, 2014
@LeaVerou
Copy link
Member

Closing, see #425

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

6 participants