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

[Feature request] Better syntax highlighting theming/coloring #2

Open
rebelC0der opened this issue Apr 26, 2023 · 4 comments
Open

[Feature request] Better syntax highlighting theming/coloring #2

rebelC0der opened this issue Apr 26, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@rebelC0der
Copy link

rebelC0der commented Apr 26, 2023

Current version, with the default Light/Dark mode:

image
image

Issue: hard to read, same theme for all languages.


Desired version:

image

Result: one, easier to read theme, with better highlighting, or the ability to choose a few different themes.

@n-peugnet
Copy link
Member

n-peugnet commented Apr 26, 2023

What method are you using for switching the "dark mode" exactly?

Here is the expected results with Flarum's integrated "Dark mode":

2023-04-26-140844_810x342_scrot

2023-04-26-140742_882x715_scrot

@rebelC0der
Copy link
Author

rebelC0der commented Apr 26, 2023

What method are you using for switching the "dark mode" exactly?

I use Flarum's native Dark Mode stuff.
Screenshot_20230426_131949


There are definitely some highlighting issues, or just bad highlighting. The main issue: it does not properly highlight function/method calls, which is very important, and is a thing in every code editor theme.


Examples of Python and Rust languages:

Proper highlighting:

Screenshot_20230426_132015
Screenshot_20230426_132422

Not good/flat highlighting:

Screenshot_20230426_132349

Is there a way to somehow configure what gets highlighted and how? If so, if you can point me in a direction of that, I could start exploring it.

@n-peugnet
Copy link
Member

Well your new screen shot does not show the same problem as the first one. The highlighting quality is a limitation of the PHP library used which is currently lagging a little behind highlight.js.

Once a newer version of this library is released, the quality of the highlighting should increase.

@n-peugnet n-peugnet added the enhancement New feature or request label May 3, 2023
@n-peugnet
Copy link
Member

@rebelC0der: The maintainer of highlight.php is actively working on porting highlight.js 11 which should enhance the highlight quality. You could consider sponsoring him for this work, but you should note that for now even highlight.js does not highlight function calls, and highlight.php strictly follows the upstream grammars, so the v11 upgrade will not add this specific highlighting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants