Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Markdown = (props: MarkdownProps) => {
const {
anchors,
children,
className,
scope,
standalone,
...restProps
} = props;
const rootProps = {
className: className ? `markdown ${className}` : 'markdown',
...restProps
};
const compile = marksy({
createElement,
elements: {
a({ href, children }: mdLinkProps) {
let linkProps = { to: href };
if (isNormalLink(href)) {
if (standalone && href.startsWith('#')) {
// When viewing a standalone example, convert any same-page anchor
// links to routed ones
linkProps = { to: href.replace('#', '') };
} else {
linkProps = { href };
}
}
return {children};
},
blockquote(props) {
...coy,
'code[class*="language-"]': {
...coy['code[class*="language-"]'],
tabSize: '2',
},
'pre[class*="language-"]': {
...coy['pre[class*="language-"]'],
backgroundColor: '',
fontSize: 12,
},
};
registerLanguage('jsx', jsx);
registerLanguage('json', json);
const compile = marksy({
createElement: React.createElement,
highlight: (language, code) =>
ReactDOMServer.renderToStaticMarkup(
{code}
),
elements: {
p: props => <p style="{{">,
},
});
const styles = {
divider: {
backgroundColor: 'rgb(236,236,236)',
height: 1,</p>
},
li: props => {
return
},
code: ({ language, code }) => {
if (language !== 'cta') {
return <pre>{code}</pre>
}
return
},
codespan: props => {
return <code>
}
}
const compile = marksy({
createElement,
elements: renderers,
components: {
Cui (props) {
return
}
}
})
const compiled = compile(children)
return compiled.tree
}
export default MarkDown</code>
...coy,
'code[class*="language-"]': {
...coy['code[class*="language-"]'],
tabSize: '2',
},
'pre[class*="language-"]': {
...coy['pre[class*="language-"]'],
backgroundColor: '',
fontSize: 12,
},
};
registerLanguage('jsx', jsx);
registerLanguage('json', json);
const compile = marksy({
createElement: React.createElement,
highlight: (language, code) =>
ReactDOMServer.renderToStaticMarkup(
{code}
),
elements: {
p: props => <p style="{{">,
},
});
const style = {
a: {
textDecoration: 'none',
color: '#2abbb0',</p>
render() {
const page = this.props.page;
const compiler = marksy({
createElement,
elements: {
img: ({src, alt}) => ,
table: ({children}) => <table></table>{children},
h1: ({children, id}) => {children},
h2: ({children, id}) => {children},
h3: ({children, id}) => {children},
h4: ({children, id}) => {children},
h5: ({children, id}) => {children},
h6: ({children, id}) => {children},
},
highlight: (language, code) => hljs.highlight(language, code).value
});
const compiled = compiler(page);