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

Bad color visual in dark mode: code #65

Closed
PeopleInside opened this issue Sep 14, 2022 · 4 comments
Closed

Bad color visual in dark mode: code #65

PeopleInside opened this issue Sep 14, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@PeopleInside
Copy link

Bug Report

Current Behavior

In Dark mode some strings of the code are not visible.

See here:
https://discuss.flarum.org/d/21492-friendsofflarum-night-mode/365

@n-peugnet
Copy link
Contributor

n-peugnet commented Jun 3, 2023

You might be interested in the extension I made that fixes this issue (among other things): CLUB1 Server Side Highlight.

It provides the following advantages:

  1. The highlighting is done on the server so it is not up to the clients to do it.
  2. The server uses the cache to save highlighted blocks to only do the processing once.
  3. It works without any JS so even on the worst web browser the highlight will be there and there is no delay before the highlighting is applied.
  4. The theme adapts itself to the "dark mode" setting of Flarum.
  5. It works even with BBCode extension disabled.
  6. Admins can choose the highlight theme for both "Light" and "Dark" Flarum variants.
  7. Admins can download highlight themes with highlight:download Flarum console command.
  8. It is compatible with fof/nightmode >= 1.5.2 by switching the highlight theme accordingly.

@PeopleInside
Copy link
Author

Thank you, but why this extension fix only new post?
Once is active will edit how message are posted so this is the reason I read the changes will be applied only to new comments? :)

@n-peugnet
Copy link
Contributor

n-peugnet commented Jun 3, 2023

Thank you, but why this extension fix only new post?
Once is active will edit how message are posted so this is the reason I read the changes will be applied only to new comments? :)

Yes, this extension applies the highlight in the backend. It modifies the parser, who is responsible for analyzing the posts when they are sent. This is to minimize the amount of processing when reading the posts.

As recommended, you can use php flarum chore:reparse from the club-1/flarum-ext-chore-commands extension to parse again all previous posts. Note that other extensions might also affects the parser, so it could change more than just the code highlighting on old posts.

@dsevillamartin
Copy link
Member

Closing since this extension isn't responsible for what dark mode looks like, only activating it.

@dsevillamartin dsevillamartin closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants