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

Javascript Highlighter seems to not work as expected #248

Closed
Neohiro79 opened this issue Nov 21, 2020 · 5 comments
Closed

Javascript Highlighter seems to not work as expected #248

Neohiro79 opened this issue Nov 21, 2020 · 5 comments

Comments

@Neohiro79
Copy link

Javscript won't work, weather with data-language="javascript" nor with class="language-javascript"

see this fiddle here:

http://jsfiddle.net/neohiro79/1grwjb50/27/

or am I missing something important here?

Also the style tags get some additional tabspace - is there a way to change this?

@ccampbell
Copy link
Owner

Javascript depends on the generic language patterns so you have to include that first. As for the style tags, <pre> blocks will format content exactly as it appears so it is probably a best practice to use spaces vs. tabs and unindent everything you want formatted.

This fork of your fiddle has it all working: https://jsfiddle.net/7kvcguez/

@Neohiro79
Copy link
Author

Thank you so much @ccampbell !!!

@Neohiro79
Copy link
Author

One more question:

Do I need to include generic.js above any other programming language except for HTML & CSS?

Or is the best way to do it like you described here:

If you want a minimized version with all languages you can pass

gulp build --languages=all

??

@ccampbell
Copy link
Owner

Certain languages depend on the generic patterns, but not all.

var needsGeneric = ['php', 'python', 'javascript', 'go', 'c', 'r', 'coffeescript', 'haskell'];

The best bet is using gulp build to create a custom bundle and passing whatever languages you want in a list. You can also use the bundler from the rainbow website, but it is using a slightly out of date version of rainbow (long story) http://rainbowco.de

@Neohiro79
Copy link
Author

Thanx for that damn quick reply Craig! You're the best!!

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

2 participants