Repo: Undesirable Plain Text Syntax Highlighting
I checked the commits since the last release of gogs, and I don't see any that signify a change in the syntax highlighting.
Once thought is that the example on Gogs doesn't have an extension, while the ones here do. That could be throwing off the syntax highlighting, not sure.
The pygments implementation was only for Pastes, so this issue doesn't apply to it. The implementation for syntax highlighting in the git repos is handled by Gogs.
You're quite right. I assumed maybe it was related to pygments because I researched in advance in gogs issues and found Syntax highlighting is done on plain text LICENSE files which was fixed, but as you suggest, and correctly, it's only working for files with no extension.
The following example confirms that it's a gogs issue. I'll contact them.
Thanks and closing.
teknik.io example 4 - OK
[EDIT] Actually the gogs team fixed it only for files specifically named
LICENSE! I can't believe this decision but I already posted a follow up to the syntax highlighting issue.
Haha, wow that's a weird way that they fixed it. Thanks for bringing it to their attention (and mine!)
@Uncled1023 In the meantime, since I didn't get a response yet (I posted it as a new issue in gogs GH page), I found this thread on gogs, which added the ability to map extensions for syntax highlighting in config.
Now, since the objective is to not highlight plain text, what should the example above be like? Not sure if this solves it.
[EDIT] Maybe leaving the value empty as in
.txt=? I know highlight.js has a
nohighlight CSS class but that would require a CSS
txt extension attribute selector hack.
@Uncled1023 Maybe my guess was right. According to Unknwon, Gog's dev, there's probably a way to disable highlighting for the
.txt extension, using highlightjs built-in
nohighlight class in Gog's
What do you think about it?
EDIT: BTW, they didn't fix it only for
LICENSE files. Specific filenames can be ignored by highlighting.
Deleting a branch is permanent. It CANNOT be undone. Continue?