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

catch single line comments in SQL language #1466

Closed
wants to merge 1 commit into from

Conversation

solugebefola
Copy link

@solugebefola solugebefola commented Mar 3, 2017

This is to catch single line comments in the SQL language when the code text is a multiline string

This is to catch single line comments when the code text is a multiline string
@solugebefola solugebefola changed the title catch single line comments catch single line comments in SQL language Mar 3, 2017
@isagalaev
Copy link
Member

Do you have a test that shows it not working before your fix and working after? I'm asking because $ already means the end of line, and it works throughout pretty much all the languages in highlight.js.

@solugebefola
Copy link
Author

solugebefola commented Mar 3, 2017

I realized that the issue was with the use of a hashmark in my text prompts which is picked up by the sql language as illegal. I was hacking a solution by splitting the code into separate lines, and it was working then, which is why I thought that the issue was with single line vs. multiline. I am withdrawing the PR.
Maybe there needs to be a 'psql' language to allow putting prompts with hashmarks in the code?

Anyway, sorry to take up your time with this. Thanks for responding so fast.

@isagalaev
Copy link
Member

There can be two different approaches to handling repl prompts. One is adding a mode that is then inserted everywhere, like in Python: https://github.com/isagalaev/highlight.js/blob/master/src/languages/python.js#L7-L9. Another is a helper language that embeds the parent language, like in Clojure: https://github.com/isagalaev/highlight.js/blob/master/src/languages/clojure-repl.js

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