Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ changes.

### Added

- Add support for the tables in markdown [Issue 3581](https://github.com/IntersectMBO/govtool/issues/3581)

### Fixed

### Changed
Expand Down
266 changes: 266 additions & 0 deletions govtool/frontend/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 govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"react-router-dom": "^6.13.0",
"rehype-katex": "^7.0.1",
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"storybook-addon-manual-mocks": "^1.0.3",
"storybook-addon-module-mock": "^1.3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { Box, Skeleton } from "@mui/material";
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
import Markdown from "react-markdown";
import remarkMath from "remark-math";
import remarkGfm from "remark-gfm";
import rehypeKatex from "rehype-katex";
import remarkBreaks from "remark-breaks";
import "katex/dist/katex.min.css";
import "./tableMarkdown.css";

import { Typography, Tooltip, CopyButton, TooltipProps } from "@atoms";
import { removeMarkdown } from "@/utils";
Expand Down Expand Up @@ -135,7 +137,7 @@ export const GovernanceActionCardElement = ({
const renderMarkdown = () => (
<Markdown
components={markdownComponents}
remarkPlugins={[remarkMath, remarkBreaks]}
remarkPlugins={[remarkMath, remarkBreaks, remarkGfm]}
rehypePlugins={[rehypeKatex]}
>
{text.toString()}
Expand Down
23 changes: 23 additions & 0 deletions govtool/frontend/src/components/molecules/tableMarkdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
table {
margin: 32px 0;
border-spacing: 0;
border-collapse: collapse;
}

table thead {
background-color: #d6e2ff80;
}

table th,
table td {
padding: 6px 13px;
border: 1px solid #d6e2ff;
}

table td > :last-child {
margin-bottom: 0;
}

table tr:nth-child(2n) {
background-color: #d6e2ff80;
}
Loading