Add appendix about text/markdown media type and file extension #607
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 MarkDownis 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:
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 identifieras 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 thatfile extensions should be compared case-insensitively when reading.