-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
.omnijs - .json #33360
Comments
could you request handling of this filetype in the syntax highlighter we use: https://github.com/alecthomas/chroma ? |
Do you mean that? Screen - https://www.dropbox.com/scl/fi/goa9w55piklfdya3h1evo/2025-01-23-01.12.28.png?rlkey=vk5l3xdgwfij767glmjlgzqz5&dl=0 |
It works as a viewing, but unfortunately it doesn't work in editing mode. This is the only progress I was able to achieve |
Recommend to send a PR to chroma to add the file extension here, it's a 1-line change: |
As for the code editor, it's more complicated. We rely on the mapping provided by Monaco, which I think may be sourced from VSCode data: gitea/web_src/js/features/codeeditor.ts Line 53 in 340d9ec
I think we may be able to make it fall back to chroma-detected language if monaco's detection fails, but one problem is that the chroma lexer name may not always match the monaco language name. |
You could also use app.ini to set highlight mapping gitea/custom/conf/app.example.ini Lines 2428 to 2434 in 340d9ec
|
Thank you, I wrote in chroma I did it, but it didn't help, maybe I wrote it wrong? |
If you wrote: [highlight.mapping]
Extension mapping to highlight class
e.g. .omnijs=json in your config, that won't work because that's just example lines telling you how to add new ones. [highlight.mapping]
.omnijs=json |
Thank you very much, this option worked great |
Description
I have files with the extension
.omnijs
In gitea they are displayed as
plaintext
, how can I make the display injson
orjavascript
format? I tried different options, but it doesn't workHere is an example of a file:
Gitea Version
1.23.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
docker
Database
None
The text was updated successfully, but these errors were encountered: