Skip to content

Commit ef8001f

Browse files
author
Tim Roes
authored
Allow frontmatter in rendered markdown (#10624)
1 parent 996031e commit ef8001f

File tree

3 files changed

+272
-4
lines changed

3 files changed

+272
-4
lines changed

airbyte-webapp/package-lock.json

Lines changed: 267 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-webapp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"react-widgets": "^4.6.1",
4848
"recharts": "^2.1.9",
4949
"rehype-urls": "^1.1.1",
50+
"remark-frontmatter": "^4.0.1",
5051
"remark-gfm": "^3.0.0",
5152
"rest-hooks": "^5.0.20",
5253
"sanitize-html": "^2.7.0",

airbyte-webapp/src/components/Markdown/Markdown.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import ReactMarkdown from "react-markdown";
33
import remarkGfm from "remark-gfm";
4+
import remarkFrontmatter from "remark-frontmatter";
45
import styled from "styled-components";
56
import type { PluggableList } from "react-markdown/lib/react-markdown";
67

@@ -16,7 +17,9 @@ const Markdown: React.FC<Props> = ({ content, className, rehypePlugins }) => {
1617
linkTarget="_blank"
1718
className={className}
1819
skipHtml
19-
remarkPlugins={[remarkGfm]}
20+
// @ts-expect-error remarkFrontmatter currently has type conflicts due to duplicate vfile dependencies
21+
// This is not actually causing any issues, but requires to disable TS on this for now.
22+
remarkPlugins={[remarkFrontmatter, remarkGfm]}
2023
rehypePlugins={rehypePlugins}
2124
children={content || ""}
2225
/>

0 commit comments

Comments
 (0)