gitea: Multinline comments in the start break syntax highlighting
- Gitea version (or commit ref): 1.7.1
- Git version: n/a
- Operating system: Windows 10
- Database (use
[x]):- PostgreSQL
- Can you reproduce the bug at https://try.gitea.io:
- Log gist: n/a
Description
When starting a file with a multiline comment or sometimes multiple lines of comments, syntax highlighting breaks (at least for .ps1 files).
For example, starting a file with one of the following works fine:
# Foo
---
<# Bar #>
---
# Bleh
#
This, however, breaks it:
<# Foo
#>
---
## Bar
##
Screenshots



About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (19 by maintainers)
Commits related to this issue
- Add a lot of extension to language mappings for syntax highlights Data partially based on [CodeMirror's meta.js](https://github.com/codemirror/CodeMirror/blob/master/mode/meta.js). Fixes: https://gi... — committed to silverwind/gitea by silverwind 5 years ago
- Add a lot of extension to language mappings for syntax highlights (#7741) Data partially based on [CodeMirror's meta.js](https://github.com/codemirror/CodeMirror/blob/master/mode/meta.js). Fixes: ... — committed to go-gitea/gitea by silverwind 5 years ago
Yeah, highlight.js weirdly does not publish a proper packed file with all languagues anywhere. I assume if we want to update it, we should include all languages which results in a 650kb file, not that much of a problem.
Once you confirm it works with in Gitea with newer highlight.js, I can raise a PR to update it. You want to use these resources:
Updated fiddle with 9.15.6: https://jsfiddle.net/vk3j2gLd/3/
All three cases look alright, correct?
A temporary local workaround could be to use a custom footer template that instead gets
highlight.jsfrom{{AppSubUrl}}/js/highlight.jsand then add the new version ofhighlight.jsto yourcustom/public/jsfolder.Docs for customizing templates
I suspect a highlight.js issue here.