Skip to content

Commit 2466a09

Browse files
java-team-github-botGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Add text/markdown to MediaType
RELNOTES=`net`: Add `text/markdown` to `MediaType` PiperOrigin-RevId: 656158830
1 parent e2b7a33 commit 2466a09

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

android/guava/src/com/google/common/net/MediaType.java

+9
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ private static MediaType addKnownType(MediaType mediaType) {
154154
public static final MediaType CSV_UTF_8 = createConstantUtf8(TEXT_TYPE, "csv");
155155
public static final MediaType HTML_UTF_8 = createConstantUtf8(TEXT_TYPE, "html");
156156
public static final MediaType I_CALENDAR_UTF_8 = createConstantUtf8(TEXT_TYPE, "calendar");
157+
158+
/**
159+
* As described in <a href="https://www.rfc-editor.org/rfc/rfc7763.html">RFC 7763</a>, this
160+
* constant ({@code text/markdown}) is used for Markdown documents.
161+
*
162+
* @since NEXT
163+
*/
164+
public static final MediaType MD_UTF_8 = createConstantUtf8(TEXT_TYPE, "markdown");
165+
157166
public static final MediaType PLAIN_TEXT_UTF_8 = createConstantUtf8(TEXT_TYPE, "plain");
158167

159168
/**

guava/src/com/google/common/net/MediaType.java

+9
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ private static MediaType addKnownType(MediaType mediaType) {
154154
public static final MediaType CSV_UTF_8 = createConstantUtf8(TEXT_TYPE, "csv");
155155
public static final MediaType HTML_UTF_8 = createConstantUtf8(TEXT_TYPE, "html");
156156
public static final MediaType I_CALENDAR_UTF_8 = createConstantUtf8(TEXT_TYPE, "calendar");
157+
158+
/**
159+
* As described in <a href="https://www.rfc-editor.org/rfc/rfc7763.html">RFC 7763</a>, this
160+
* constant ({@code text/markdown}) is used for Markdown documents.
161+
*
162+
* @since NEXT
163+
*/
164+
public static final MediaType MD_UTF_8 = createConstantUtf8(TEXT_TYPE, "markdown");
165+
157166
public static final MediaType PLAIN_TEXT_UTF_8 = createConstantUtf8(TEXT_TYPE, "plain");
158167

159168
/**

0 commit comments

Comments
 (0)