-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
87 changed files
with
13,916 additions
and
11,533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ testem.log | |
# System Files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
.nx/cache | ||
.nx/workspace-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/vscode-windhawk-ui/apps/vscode-windhawk-ui/src/app/components/ReactMarkdownCustom.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import ReactMarkdown from 'react-markdown'; | ||
import rehypeSlug from 'rehype-slug'; | ||
import remarkGfm from 'remark-gfm'; | ||
import styled from 'styled-components'; | ||
|
||
const ReactMarkdownWithStyle = styled(ReactMarkdown)` | ||
// Word-wrap long lines. | ||
overflow-wrap: break-word; | ||
// https://github.com/micromark/micromark-extension-gfm-table#css | ||
table { | ||
border-spacing: 0; | ||
border-collapse: collapse; | ||
display: block; | ||
margin-top: 0; | ||
margin-bottom: 16px; | ||
width: max-content; | ||
max-width: 100%; | ||
overflow: auto; | ||
} | ||
tr { | ||
background-color: var(--color-canvas-default); | ||
border-top: 1px solid var(--color-border-muted); | ||
} | ||
tr:nth-child(2n) { | ||
background-color: var(--color-canvas-subtle); | ||
} | ||
td, | ||
th { | ||
padding: 6px 13px; | ||
border: 1px solid var(--color-border-default); | ||
} | ||
th { | ||
font-weight: 600; | ||
} | ||
table img { | ||
background-color: transparent; | ||
} | ||
`; | ||
|
||
interface Props { | ||
markdown: string; | ||
} | ||
|
||
function ReactMarkdownCustom({ markdown }: Props) { | ||
return ( | ||
<ReactMarkdownWithStyle | ||
children={markdown} | ||
rehypePlugins={[ | ||
rehypeSlug, | ||
remarkGfm, | ||
]} | ||
/> | ||
); | ||
} | ||
|
||
export default ReactMarkdownCustom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.