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

Allow frontmatter in rendered markdown #10624

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 267 additions & 3 deletions airbyte-webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions airbyte-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"react-widgets": "^4.6.1",
"recharts": "^2.1.9",
"rehype-urls": "^1.1.1",
"remark-frontmatter": "^4.0.1",
"remark-gfm": "^3.0.0",
"rest-hooks": "^5.0.20",
"sanitize-html": "^2.7.0",
Expand Down
5 changes: 4 additions & 1 deletion airbyte-webapp/src/components/Markdown/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import remarkFrontmatter from "remark-frontmatter";
import styled from "styled-components";
import type { PluggableList } from "react-markdown/lib/react-markdown";

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