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

Fix regression in Bash strings #792

Merged
merged 1 commit into from
Oct 5, 2015
Merged

Conversation

zeitgeist87
Copy link
Collaborator

In a recent patch the regex for single-quoted and double-quoted
strings of the Bash language was split into two separate regexes
to prevent the highlighting of variables inside of single-quoted
strings.

This causes a bug whenever a double-quoted string apears inside a
single-quoted string, because the double-quoted string is matched
first.

'"foo"'

The same problem exists with the newly introduced Here-Documents.
This patch fixes the problem by matching Here-Documents first and
merging the regexes for single-quoted and double-quoted
strings again.

This patch also adds testcases for this, to prevent future
regressions.

In a recent patch the regex for single-quoted and double-quoted
strings of the Bash language was split into two separate regexes
to prevent the highlighting of variables inside of single-quoted
strings.

This causes a bug whenever a double-quoted string apears inside a
single-quoted string, because the double-quoted string is matched
first.

'"foo"'

The same problem exists with the newly introduced Here-Documents.
This patch fixes the problem by matching Here-Documents first and
merging the regexes for single-quoted and double-quoted
strings again.

This patch also adds testcases for this, to prevent future
regressions.
@zeitgeist87
Copy link
Collaborator Author

The regression was introduced by my latest patch series for the Bash language. Sorry for the mess :(

@Golmote
Copy link
Contributor

Golmote commented Oct 5, 2015

Thanks for fixing it

Golmote added a commit that referenced this pull request Oct 5, 2015
Fix regression in Bash strings
@Golmote Golmote merged commit bd275c2 into PrismJS:gh-pages Oct 5, 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