-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bash improvements #1443
Bash improvements #1443
Conversation
Hi! Wow this looks great! I'll try to do a proper review this week-end. From a really quick look, I can already tell that some indentations are weird (note that we do use tabs for indentation in Prism), and that you should probably add a
Most of the time, components need to be actually used extensively to reveal their flaws. I'm glad you took the time to improve the component to fit your needs and even submitted a PR for it! Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did an amazing work here! Thank you so much for this.
Would you mind taking a look at my comments?
Also, as I mentionned earlier, the indentation should use tabs everywhere.
On a side note:
Issue #1457 popped up recently. I wonder if we should allow one nested level of parentheses inside Command Substitution variables, since this seems to be a common use case.
It should lead to a regexp like:
/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/
The regexp gets a bit uglier but it's the cost to pay... Would you mind taking a look at it in this PR?
It won't fix the issue of nested double quotes that I've seen on multiple occasions in your document, though, but that's a start.
Thanks for your time and for those comments. I'll do my best to fix all that. |
Re: #1457, the issue is that the |
|
For #1457, note that if you allow a pair of parentheses within |
Hm that's weird. Please don't commit it. Are there actual differences in the git diff?
|
Git diff shows a bunch of differences, but as it is a minified file it's not really readable. |
I think I took most of the comments into account. I have yet to try to simplify the operator list, though, and I did nothing regarding #1457. I'll have lunch, for now. 😄 |
Found the Kotlin commit here: 41e3d6a It was done right after you opened this PR, so your version is a bit behind |
Yeah, I haven't pulled from Prism's repository for a while. Does that mean that I should now, or is it OK as long as the only files I edited did not change in the meantime? Travis seemed happy so I did not give it much thought. |
Don't worry, as long as the merge can be made without conflict, this is fine. |
Not sure what exactly is happening. According to the tag changes, it seems @Golmote acknowledged my changes and intends to check them or to let someone else do so. I'm on standby, should any new remark surface. |
bbe6cab
to
59a242d
Compare
Hi everyone. Wanted to see how things were going. Noticed conflicts sprouted after #1577 was merged. I tried to compute the union of the commands listed in the two PRs, still excluding shell builtins that tend to be mistaken for external commands. Looks like the conflicts are gone, now. Pfiou. Not used to working with multiple Git remotes. 😅 /cc @Golmote Still not sure why this PR is stalled right at the final-ish review stage. 😢 A few months ago, I used my version again (for a Reveal.js slideshow to teach Bash stuff to my workmates) and didn't notice anything weird. Prism is fun. |
@RunDevelopment Would you mind taking a pass through this PR and providing a final sign off & merge if everything looks good? These look like good improvements, so might be nice to get them landed. |
@mAAdhaTTah I'm quite busy at the moment, so it might take a while until I get to it. |
@RunDevelopment No worries! Just wanted to get your attention. @alice-mm This just fell through the cracks. I know Golmote's been busy as well so he probably just didn't have a chance to get back to it. I unfortunately have little / no regex skills, so I usually defer to my co-maintainers to review that stuff. |
No problem! Indeed, his profile seems to show that his activity plummeted around the time of his reviews of this PR. |
PrismJS#1443 (review) “All themes except Tomorrow Night and Twilight highlight builtin tokens and string tokens with the same color. Syntax highlighting with just one color is kind of useless, so I suggest that we give the builtin token a class-name alias to change the style.”
4ed7850
to
c2e279c
Compare
Couldn't help myself; did that at work during my lunch break. I hope I correctly understood what was to be done. 😣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
Thank you very much for contributing!
First and foremost, sorry for the rather large pull request. Most of these edits were made while writing some kind of Bash tutorial and I initially had no ambition of contributing. I didn't even have a non-pro GitHub account.
I was using Prism to write this thing. I had tons of fun, but I also noticed that lots of things were missing. If I recall correctly, even the
esac
keyword (used to close “switch” statements) was nowhere to be found despitecase
being here.To sum most of these things up, here's a HTML document that can be used to do some kind of “before / after” comparison:
I added a tiny bit of CSS in order to make it easier to distinguish things that used the same style in the theme I loaded (“Tomorrow night”).
I had to update / adapt tests and used the opportunity to add new test cases covering new features.
I did my best but I'm no JS expert, so there's probably room for improvement, but I have to say I like the result a lot. To check more realistic examples, you can simply take a look at the snippets from the tutorial-ish document I was writing when customizing this language definition.