This PR adds syntax highlighting for HTTP Live Streaming playlists (.m3u8):
https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-11
Feedbacks are welcome, especially regarding good practices for syntax plugins.
https://github.com/vim/vim/pull/11204
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@benoitryder pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Can we use a nicer name for this filetype? Perhaps hlsplaylist?
hlsplaylist is good. I changed the name, and added the test as requested.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
The syntax file is using line continuation. the 'cpo' option needs to be set and restored. Se other syntax files for an example.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks for noticing. I fixed it on my branch but since the the PR was already closed, the diff does not include it.
Updated file available here.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
The .m3u extension is also valid. Also, I think mpegurl would be a better name.
https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-17.html#section-4
Each Playlist file MUST be identifiable by either the path component
of its URI or by HTTP Content-Type. In the first case, the path MUST
end with either .m3u8 or .m3u. In the second, the HTTP Content-type
MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl".
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
HLS playlists are based on the old M3U format, but they define their own format. It is not a superset of the M3U format with its common extensions, and it has not the same purpose. The HLS playlist mime-type is mpegurl most likely for historical reasons. But this name is never used when working with HLS. Using it has filetype can be confusing for users.
I've never seen the .m3u extension being used for HLS playlists. IMHO it's fine to not support it (and maybe reserve it for the old M3U format if support is added in the future), but adding it would not hurt.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
M3U8 is just M3U with UTF-8 character encoding.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Are the .m3u8 and .m3u files different enough to justify a different filetype? Would they need different settings, indenting and syntax?
Syntax is compatible. But HLS playlists define elements specific to them, and don't use elements specific to M3U playlists. So both formats are compatible, but neither strict superset nor subset of each other.
Technically, the extension alone is not enough identify a .m3u8/.m3u as an M3U playlist or an HLS playlist. Hence some confusion in previous comments.
The proposed syntax file does not provide highlighting to tags not supported by HLS playlists but used by M3U playlists (but it could). It does not highlight wrong/erroneous constructs as errors; if it did, errors to report would not be the same for both cases.
What if we just call it "playlist", would that have a problem?
There are other playlist formats that use a completely different syntax (e.g. .pls). m3uplaylist would be a better compromise, recognizable by users.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
If we would have separate file types, we would have to inspect the contents to see what it is?
Yes. We could check for a line starting with #EXT-X- among the first lines; and if there is one, consider it's an HLS playlist.
Note that some content providers add comments or empty lines at the beginning, so a good heuristic would be need to be smarter (e.g. defaulting to "HLS playlist" if extension is .m3u8 and M3U if extension is .m3u).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
So we should also recognize *.m3u, or are only *.m3u8 files used for hlsplaylist?
Both are technically valid for HLS playlists, so we can recognize both.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/11204/c1256349075%40github.com.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()