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

JavaScript syntax highlighting breaks #3682

Closed
realies opened this issue Mar 16, 2018 · 5 comments · Fixed by #12047
Closed

JavaScript syntax highlighting breaks #3682

realies opened this issue Mar 16, 2018 · 5 comments · Fixed by #12047
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Milestone

Comments

@realies
Copy link

realies commented Mar 16, 2018

The title should be concise enough. Tested against 1324d62 .

screen shot 2018-03-16 at 22 48 41

The comment highlighting continues until EOF.

@lunny lunny added the type/bug label Mar 17, 2018
@lafriks
Copy link
Member

lafriks commented Mar 17, 2018

As our used library for syntax highlighting is not maintained anymore we should probably switch to https://github.com/PrismJS/prism for example

@realies realies changed the title JavaScript syntax highlighting breaks under certain conditions JavaScript syntax highlighting breaks Mar 17, 2018
@tankerkiller125
Copy link

tankerkiller125 commented May 16, 2018

@lafriks As another note regarding prism has the autoloader plugin would greatly reduce the amount of JS being moved around as it would be loading one language at a time instead of all of them the way highlightjs currently does.

@lafriks
Copy link
Member

lafriks commented May 16, 2018

@tankerkiller125 that would be doable but problem is that for larger diff/code pages prism performance is quite bad :(

@daviian
Copy link
Member

daviian commented May 16, 2018

@lafriks Maybe we should use something like https://github.com/alecthomas/chroma

This one is also used in Huge AFAIK

@techknowlogick techknowlogick added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Jan 23, 2019
@ghost
Copy link

ghost commented Jun 21, 2019

Hey, any news about this issue?
I'm currently facing the same problem in C++ when using Doxygen style comments:

Over a structure:
2019-06-21_10-08-26

Over a function member:
2019-06-21_10-08-59

mrsdizzie added a commit to mrsdizzie/gitea that referenced this issue Jun 24, 2020
This PR does a few things:

* Remove all traces of highlight.js
* Use chroma library to provide fast syntax hilighting directly on the server
* Provide syntax hilighting for diffs
* Re-style both unified and split diffs views
* Add custom syntax hilighting styling for both regular and arc-green

Fixes go-gitea#7729
Fixes go-gitea#10157
Fixes go-gitea#11825
Fixes go-gitea#7728
Fixes go-gitea#3872
Fixes go-gitea#3682

And perhaps gets closer to go-gitea#9553
@lafriks lafriks added this to the 1.13.0 milestone Jun 30, 2020
lafriks added a commit that referenced this issue Jun 30, 2020
* Server-side syntax hilighting for all code

This PR does a few things:

* Remove all traces of highlight.js
* Use chroma library to provide fast syntax hilighting directly on the server
* Provide syntax hilighting for diffs
* Re-style both unified and split diffs views
* Add custom syntax hilighting styling for both regular and arc-green

Fixes #7729
Fixes #10157
Fixes #11825
Fixes #7728
Fixes #3872
Fixes #3682

And perhaps gets closer to #9553

* fix line marker

* fix repo search

* Fix single line select

* properly load settings

* npm uninstall highlight.js

* review suggestion

* code review

* forgot to call function

* fix test

* Apply suggestions from code review

suggestions from @silverwind thanks

Co-authored-by: silverwind <me@silverwind.io>

* code review

* copy/paste error

* Use const for highlight size limit

* Update web_src/less/_repository.less

Co-authored-by: Lauris BH <lauris@nix.lv>

* update size limit to 1MB and other styling tweaks

* fix highlighting for certain diff sections

* fix test

* add worker back as suggested

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this issue Jul 31, 2020
* Server-side syntax hilighting for all code

This PR does a few things:

* Remove all traces of highlight.js
* Use chroma library to provide fast syntax hilighting directly on the server
* Provide syntax hilighting for diffs
* Re-style both unified and split diffs views
* Add custom syntax hilighting styling for both regular and arc-green

Fixes go-gitea#7729
Fixes go-gitea#10157
Fixes go-gitea#11825
Fixes go-gitea#7728
Fixes go-gitea#3872
Fixes go-gitea#3682

And perhaps gets closer to go-gitea#9553

* fix line marker

* fix repo search

* Fix single line select

* properly load settings

* npm uninstall highlight.js

* review suggestion

* code review

* forgot to call function

* fix test

* Apply suggestions from code review

suggestions from @silverwind thanks

Co-authored-by: silverwind <me@silverwind.io>

* code review

* copy/paste error

* Use const for highlight size limit

* Update web_src/less/_repository.less

Co-authored-by: Lauris BH <lauris@nix.lv>

* update size limit to 1MB and other styling tweaks

* fix highlighting for certain diff sections

* fix test

* add worker back as suggested

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
6 participants