feat: Implemented wrapper for md parser so we can pass custom options
Signed-off-by: Raul Kele <raulkeleblk@gmail.com>
This commit is contained in:
parent
72f8c7cd61
commit
0b71b86db5
@ -17,7 +17,7 @@ import repocube4 from '../assets/repocube-4.png';
|
||||
//icons
|
||||
import GppBadOutlinedIcon from '@mui/icons-material/GppBadOutlined';
|
||||
import GppGoodOutlinedIcon from '@mui/icons-material/GppGoodOutlined';
|
||||
import Markdown from 'markdown-to-jsx';
|
||||
import { Markdown } from 'utilities/MarkdowntojsxWrapper';
|
||||
|
||||
// temporary utility to get image
|
||||
const randomIntFromInterval = (min, max) => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
|
||||
import makeStyles from '@mui/styles/makeStyles';
|
||||
import { DateTime } from 'luxon';
|
||||
import Markdown from 'markdown-to-jsx';
|
||||
import { Markdown } from 'utilities/MarkdowntojsxWrapper';
|
||||
import React from 'react';
|
||||
import transform from '../utilities/transform';
|
||||
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
Tooltip,
|
||||
Typography
|
||||
} from '@mui/material';
|
||||
import Markdown from 'markdown-to-jsx';
|
||||
import { Markdown } from 'utilities/MarkdowntojsxWrapper';
|
||||
import transform from 'utilities/transform';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
|
||||
import makeStyles from '@mui/styles/makeStyles';
|
||||
import { DateTime } from 'luxon';
|
||||
import Markdown from 'markdown-to-jsx';
|
||||
import { Markdown } from 'utilities/MarkdowntojsxWrapper';
|
||||
import React from 'react';
|
||||
import transform from '../utilities/transform';
|
||||
|
||||
|
13
src/utilities/MarkdowntojsxWrapper.jsx
Normal file
13
src/utilities/MarkdowntojsxWrapper.jsx
Normal file
@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import Markdown from 'markdown-to-jsx';
|
||||
|
||||
const MarkdownWrapper = (props) => {
|
||||
const { children, options } = props;
|
||||
return (
|
||||
<Markdown {...props} options={{ ...options, overrides: { a: { props: { target: '_blank' } } } }}>
|
||||
{children}
|
||||
</Markdown>
|
||||
);
|
||||
};
|
||||
|
||||
export { MarkdownWrapper as Markdown };
|
Loading…
x
Reference in New Issue
Block a user