Integrated MD Preview component with mediaproxy

This commit is contained in:
Andrey Okonetchnikov 2016-09-26 15:59:49 +02:00
parent cdc71a2bbf
commit 71c638bc27

View File

@ -2,6 +2,15 @@ import React, { PropTypes } from 'react';
import { getSyntaxes } from './richText';
import MarkitupReactRenderer from './MarkitupReactRenderer';
const schema = {
'mediaproxy': ({ token }) => (
<img
src={token.getIn(['data', 'src'])}
alt={token.getIn(['data', 'alt'])}
/>
)
};
const MarkdownPreview = ({ value }) => {
if (value == null) {
return null;
@ -12,6 +21,7 @@ const MarkdownPreview = ({ value }) => {
<MarkitupReactRenderer
value={value}
syntax={markdown}
schema={schema}
/>
);
};