google / google/playground-elements

Use filetypes over mime-types for syntax highlighting

Open
#329 0 comments 0 reactions 1 assignee Claimed by @taylor-vann View on GitHub
Dominant language
TypeScript
Stars
648
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Non traditional types like `tsx` default to the `application/octect-stream` mime-type. During a fetch (initial load) `tsx` will have a mime-type of `application/octect-stream` and will not have syntax highlights as a consequence.

Currently, we use `mime-types` to infer syntax highlighting. However, servers are less than consistent with `mime-types`.

It is possible to avoid `mime-types` entirely and instead highlight by `file-type`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.