Skip to content

Latest commit

 

History

History
141 lines (108 loc) · 5.08 KB

MIME-TYPES.md

File metadata and controls

141 lines (108 loc) · 5.08 KB

MIME Types and Lang attributes

This are the allowed mime-types for script, style xml-stylesheet and link tags

Summary

Script tag

Lang attribute

List of allowed lang attribute values that will change the embedded code detection:

ℹ️ Not setting a lang attribute will automatically fallback to any of the type attribute detection, or fallback to Javascript

  • javascript
    • the embedded code will be displayed as Javascript
  • typescript
    • the embedded code will be displayed as Typescript
  • coffeescript
    • the embedded code will be displayed as Coffeescript
  • dart
    • the embedded code will be displayed as Dart

Type attribute

List of allowed type attribute values that will change the embedded code detection:

ℹ️ Not setting a type attribute will automatically fallback to any of the lang attribute detection, or fallback to Javascript

⚠️ Please note that some of the used MIME types are not defined by IANA and were created based on the Javascript ones.

  • Content will be displayer as Javascript
    • module
    • text/javascript prefered ✔️
    • text/ecmascript deprecated but allowed ⚠️
    • text/x-javascript deprecated but allowed ⚠️
    • text/x-ecmascript deprecated but allowed ⚠️
    • application/javascript deprecated but allowed ⚠️
    • application/ecmascript deprecated but allowed ⚠️
    • application/x-javascript deprecated but allowed ⚠️
    • application/x-ecmascript deprecated but allowed ⚠️
  • Content Will be displayerd as Typescript
    • text/typescript not a standard MIME-type ⚠️
    • text/x-typescript not a standard MIME-type ⚠️
    • application/typescript not a standard MIME-type ⚠️
    • application/x-typescript not a standard MIME-type ⚠️
  • Content will be displayed as Coffeescript
    • text/coffeescript not a standard MIME-type ⚠️
    • text/x-coffeescript not a standard MIME-type ⚠️
    • application/coffeescript not a standard MIME-type ⚠️
    • application/x-coffeescript not a standard MIME-type ⚠️
  • Content will be displayed as Dart
    • text/dart not a standard MIME-type ⚠️
    • text/x-dart not a standard MIME-type ⚠️
    • application/dart not a standard MIME-type ⚠️
    • application/x-dart not a standard MIME-type ⚠️

Style tag

Lang attribute

List of allowed lang attribute values that will change the embedded code detection:

ℹ️ Not setting a lang attribute will automatically fallback to any of the type attribute detection, or fallback to CSS

  • css
    • the embedded code will be displayed as CSS
  • less
    • the embedded code will be displayed as LESS
  • scss
    • the embedded code will be displayed as SCSS
  • sass
    • the embedded code will be displayed as SASS
  • postcss
    • the embedded code will be displayed as PostCSS
  • stylus
    • the embedded code will be displayed as Stylus
  • styl
    • the embedded code will be displayed as Stylus

Type attribute

List of allowed type attribute values that will change the embedded code detection:

ℹ️ Not setting a type attribute will automatically fallback to any of the lang attribute detection, or fallback to Javascript

⚠️ Please note that some of the used MIME types are not defined by IANA and were created based on the Javascript ones.

  • Content will be displayer as CSS
    • text/css standard MIME-type ✔️
  • Content Will be displayerd as LESS
    • text/less not a standard MIME-type ⚠️
  • Content will be displayed as SCSS
    • text/scss not a standard MIME-type ⚠️
  • Content will be displayed as SASS
    • text/sass not a standard MIME-type ⚠️
  • Content will be displayed as PostCSS
    • text/postcss not a standard MIME-type ⚠️
  • Content will be displayed as Stylus
    • text/styl not a standard MIME-type ⚠️
    • text/stylus not a standard MIME-type ⚠️

XML-Stylesheet and link tags

These tags will not change content detection as they are void elements. But they will have language visual differentiation

XML-Stylesheet tag

List of type attribute values that will have visual differentiation

  • text/css
  • text/xml
  • text/xls

Link tag

List of type attribute values that will have visual differentiation

  • text/css
  • text/less
  • text/sass
  • text/scss
  • text/styl
  • text/stylus
  • text/postcss

Reference