Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add appendix about text/markdown media type and file extension #607

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stain
Copy link

@stain stain commented Sep 13, 2019

in particular to indicate the registered CommonMark variant.

My addition also included below for convenience:

Appendix: Media Type and file extension

MarkDown is primarily intended as a "write" format for generating HTML,
which could then be served over HTTP with the
Content-Type header
text/html or similar. However there may be cases where MarkDown
is served as-is, for instance as part of HTTP-based editing of
the MarkDown source.

Media Type

HTTP clients and servers can indicate that a resource is
MarkDown of the CommonMark variant, encoded in character set UTF-8,
by using the HTTP header:

Content-Type: text/markdown; charset=UTF-8; variant=CommonMark

Background: RFC7763 registers
text/markdown
in the IANA media type registry.
RFC7764 registers
CommonMark as a variant of MarkDown.

File Extension

To indicate a local file is a MarkDown file compliant with CommonMark it
is recommended to use the file extension .commonmark.md although
.commonmark.markdown may also be used.

Background: RFC7764 section 2.1
recommends using .markdown or .md with the variant identifier
as a prefix to the file extension. As file extensions tend to be all
lowercase and some file systems preserve file case,
the variant is expressed as commonmark - note however that
file extensions should be compared case-insensitively when reading.

..indicating the CommonMark variant
@Crissov
Copy link
Contributor

Crissov commented Sep 13, 2019

Well, the best use case for text/markdown would be single-part emails. Unfortunately, some MUAs cannot handle mails correctly that do not use the default text/plain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants