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

Add Nginx #776

Merged
merged 9 commits into from
Sep 23, 2015
Merged

Add Nginx #776

merged 9 commits into from
Sep 23, 2015

Conversation

westonganger
Copy link
Contributor

Adding Nginx highlighting.
Extracted from this gist https://gist.github.com/misiek08/6566480

@Golmote
Copy link
Contributor

Golmote commented Sep 22, 2015

Thanks for contributing! Would you mind adding an example file, that reflects most of the features and flaws, following the format of the existing ones ?

@Golmote
Copy link
Contributor

Golmote commented Sep 22, 2015

Also, please keep your changes on separated branches, so that this PR contains only Nginx-related stuff. You just pushed vim support ^^


Prism.languages.nginx = Prism.languages.extend('clike', {
comment: {
pattern: /(^|[^"{\\])(#.*?(\r?\n|$))/,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need a lookbehind: true here, so that no char is consumed before the comment.
Also, you probably don't need the last group ; /(^|[^"{\\])#.*/ should be enough (since it does not match line feeds).

@Golmote
Copy link
Contributor

Golmote commented Sep 22, 2015

I did a quick review. Please take a look at my inline comments.

Golmote added a commit that referenced this pull request Sep 23, 2015
@Golmote Golmote merged commit dc4fc19 into PrismJS:gh-pages Sep 23, 2015
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

Successfully merging this pull request may close these issues.

2 participants