From 42219ab655090ea1194e1b8e280ed8e86b31abbe Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Thu, 23 Jan 2020 21:36:49 +0100 Subject: webui: custom image tag --- webui/src/Content.js | 7 ++++++- webui/src/tag/ImageTag.js | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 webui/src/tag/ImageTag.js diff --git a/webui/src/Content.js b/webui/src/Content.js index 19f57631..737c5ab2 100644 --- a/webui/src/Content.js +++ b/webui/src/Content.js @@ -2,12 +2,17 @@ import unified from 'unified'; import parse from 'remark-parse'; import html from 'remark-html'; import remark2react from 'remark-react'; +import ImageTag from './tag/ImageTag'; const Content = ({ markdown }) => { const processor = unified() .use(parse) .use(html) - .use(remark2react); + .use(remark2react, { + remarkReactComponents: { + img: ImageTag, + }, + }); return processor.processSync(markdown).contents; }; diff --git a/webui/src/tag/ImageTag.js b/webui/src/tag/ImageTag.js new file mode 100644 index 00000000..aea65e9d --- /dev/null +++ b/webui/src/tag/ImageTag.js @@ -0,0 +1,15 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/styles'; + +const useStyles = makeStyles({ + tag: { + maxWidth: '100%', + }, +}); + +const ImageTag = (props) => { + const classes = useStyles(); + return +}; + +export default ImageTag; \ No newline at end of file -- cgit