#3440 add basic specfile syntax highlighting in the new commit view
Merged by pingou. Opened by ryanlerch.
ryanlerch/pagure commit-specfile-highlighting  into  master

Download 3440.patch
no initial comment

This should be called rpm-spec, because specfile is too generic.

rpm, spec

RemovePathPostfixes is missing.

For note, full reference of tags: https://github.com/rpm-software-management/rpm/blob/53036261dda93885106901a983976eb0e9ee6ea2/build/parsePreamble.c#L973-L1021

Changelogs also support the full date-style timestamp, per: https://github.com/rpm-software-management/rpm/commit/57f94a582602f0353cdb17a02dc12c4461d4f32d

While I was lost in the world of fedora-packages I found this https://github.com/fedora-infra/fedora-packages/blob/master/fedoracommunity/lib/utils.py#L248

That could be useful to compare the regex :hear_no_evil:

While I was lost in the world of fedora-packages I found this https://github.com/fedora-infra/fedora-packages/blob/master/fedoracommunity/lib/utils.py#L248
That could be useful to compare the regex 🙉

yeah, this was somewhat based on the pygments regexes, but getting stuff working in the way hilight.js does it was abit tricky. Also, i don't really know regexes at all, so i am about at the end of my knowledge here.

@ngompa will change specfile.

highlight.js uses the aliases as a first level of detection of the filetype, so aliases should stay as just 'spec'

I went with rpm-specfile

didn't touch this one (cf comment from Ryan)

Added RemovePathPostfixes

Don't know how to fix this one so I'm leaving it as it is.

rebased onto 97c35f7a556a2b0debd4d66d65af8ba2fc916ce8

Basic testing looks fine to me, thanks @ryanlerch! :)

Pull-Request has been merged by pingou

Metadata