jakubgarfield / Bonobo-Git-Server

Bonobo Git Server for Windows is a web application you can install on your IIS and easily manage and connect to your git repositories. Go to homepage for release and more info.
http://bonobogitserver.com
MIT License
1.81k stars 603 forks source link

Apostrophe in code breaks format highlighting #774

Open MaxAnderson95 opened 6 years ago

MaxAnderson95 commented 6 years ago

Currently running a fresh install of 6.3.0.632. I've uploaded a PowerShell script to a new repo. An apostrophe in the comment based help breaks the format highlighting.

Example

Removing the apostrophe resolved the issue. Not sure how you want to go about this, but I can tell you that comment based help in PowerShell is encased in <# ... #>.

Thanks for this great Git Server!

Nu11u5 commented 6 years ago

Bonobo uses Highlight.js v9.1.0 (2 years old) for syntax highlighting. It looks like a lot of PowerShell issues were fixed a few months later - isagalaev/highlight.js#1152. We would just have to merge the latest release of Highlight.js to fix this.

Corey-M commented 6 years ago

I had some issues with code formatting with C# as well, on v6.2.1. Replacing the included Scripts\highlight.pack.js file with the latest version from highlightjs.org fixed the issue for me. Not sure which languages you have in the bundled version of the script, so I grabbed the full version used in the demo page.

MaxAnderson95 commented 6 years ago

I can also confirm that downloading v6.2.1 (I only included common + PowerShell) and replacing the Scripts\highlight.pack.js file with the new one solved my issue with incorrect syntax highlighting due to the apostrophe.