Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Markdown, { compiler } from 'markdown-to-jsx';
import * as React from 'react';
import { render } from 'react-dom';
render(# Hello world!, document.body);
Hello there old chap!;
compiler('Hello there old chap!', { forceBlock: true });
# You got it babe!;
const MyParagraph: React.FunctionComponent = ({ children, ...props }) => (
<div>{children}</div>
);
render(
function Markdown({ text, inline }) {
const overrides = inline ? inlineOverrides : baseOverrides;
return compiler(text, { overrides, forceBlock: true });
}
const Markdown = ({ text }) => compiler(text, { overrides, forceBlock: true });
function Markdown({ classes, text, inline }) {
const overrides = inline ? getInlineOverrides(classes) : getBaseOverrides(classes);
return compiler(text, { overrides });
}
export const Markdown: React.FunctionComponent = ({ text, inline }) => {
const overrides = inline ? inlineOverrides : baseOverrides;
return compiler(stripHtmlComments(text), { overrides, forceBlock: true });
};
const Markdown = ({
children,
overrides,
forceBlock,
forceInline,
transformer
}) => {
deprecate('Markdown has been deprecated.');
const options = { overrides, forceBlock, forceInline };
const transformedMarkdown = transformer(children);
const html = compiler(transformedMarkdown, options);
return html;
};
const Markdown = ({ text }) => compiler(text, { overrides, forceBlock: true });
function Markdown({ text, inline }) {
const overrides = inline ? inlineOverrides : baseOverrides;
return compiler(text, { overrides, forceBlock: true });
}
const ShowMarkdown = (props) => {
return <div>
{
props.text
? markdownCompiler(props.text)
: props.diff
? markdownCompiler(diffToHtml(props.diff))
: null
}
</div>
}
const ShowMarkdown = (props) => {
return <div>
{
props.text
? markdownCompiler(props.text)
: props.diff
? markdownCompiler(diffToHtml(props.diff))
: null
}
</div>
}