+{"ast":null,"code":"import React from \"react\";\nvar __jsx = React.createElement;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport ReactMarkdown from \"react-markdown\";\nimport { H1, H2, H3, H4, H5, Table, Paragraph } from \"@vandebron/windmolen\";\nimport { PrismAsync as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport { okaidia } from \"react-syntax-highlighter/dist/cjs/styles/prism\";\nimport rehypeRaw from 'rehype-raw';\nimport remarkGfm from 'remark-gfm';\nexport default function Markdown({\n children\n}) {\n return __jsx(ReactMarkdown, {\n children: children,\n rehypePlugins: [rehypeRaw, remarkGfm],\n components: {\n hr: React.Fragment,\n h1: ({\n children\n }) => {\n return __jsx(H1, null, children);\n },\n h2: ({\n children\n }) => {\n return __jsx(H2, null, children);\n },\n h3: ({\n children\n }) => {\n return __jsx(H3, null, children);\n },\n h4: ({\n children\n }) => {\n return __jsx(H4, null, children);\n },\n h5: ({\n children\n }) => {\n return __jsx(H5, null, children);\n },\n p: props => __jsx(Paragraph, props),\n ol: ({\n children\n }) => __jsx(\"ol\", {\n style: {\n marginBlockStart: 0,\n marginBlockEnd: 30\n }\n }, children),\n ul: ({\n children\n }) => __jsx(\"ol\", {\n style: {\n marginBlockStart: 0,\n marginBlockEnd: 30\n }\n }, children),\n li: ({\n children\n }) => __jsx(Paragraph, {\n as: \"li\",\n style: {\n marginBottom: 0\n }\n }, children),\n a: (_ref) => {\n let {\n children\n } = _ref,\n props = _objectWithoutProperties(_ref, [\"children\"]);\n\n return __jsx(\"a\", _extends({}, props, {\n style: {\n color: \"inherit\"\n },\n target: 'target' in props || props['href'].includes('#') ? undefined : '_blank'\n }), children);\n },\n code: (_ref2) => {\n let {\n node,\n inline,\n className,\n children\n } = _ref2,\n props = _objectWithoutProperties(_ref2, [\"node\", \"inline\", \"className\", \"children\"]);\n\n const match = /language-(\\w+)/.exec(className || '');\n return !inline && match ? __jsx(SyntaxHighlighter, _extends({\n style: okaidia,\n language: match[1],\n PreTag: \"div\",\n children: String(children).replace(/\\n$/, '')\n }, props)) : __jsx(\"code\", _extends({\n className: className\n }, props, {\n style: {\n background: \"rgb(0,0,0, 0.1)\",\n padding: \"2px 4px\",\n fontSize: \"80%\",\n color: \"#000\"\n }\n }), children);\n },\n img: (_ref3) => {\n let {\n src,\n alt\n } = _ref3,\n props = _objectWithoutProperties(_ref3, [\"src\", \"alt\"]);\n\n return __jsx(\"img\", _extends({\n src: src,\n alt: alt,\n style: {\n width: \"100%\"\n }\n }, props));\n },\n table: ({\n children,\n className\n }) => {\n return __jsx(Table, {\n tableStyle: \"solid-borders\",\n className: className,\n style: {\n 'borderCollapse': 'collapse',\n 'marginBottom': '5%',\n 'marginLeft': '5%',\n 'marginRight': '5%',\n 'fontSize': '18px'\n },\n align: \"center\"\n }, children);\n },\n thead: ({\n children,\n style\n }) => __jsx(Table.Thead, {\n style: _objectSpread({\n 'color': 'black'\n }, style)\n }, children),\n tbody: ({\n children,\n style\n }) => __jsx(Table.Tbody, {\n style: style\n }, children),\n tr: ({\n children,\n style\n }) => __jsx(Table.Row, {\n style: _objectSpread({\n 'borderBottom': '1px solid #000'\n }, style)\n }, children),\n td: ({\n children,\n style\n }) => __jsx(Table.Cell, {\n style: style\n }, children),\n th: ({\n children,\n style\n }) => __jsx(Table.Cell, {\n style: style\n }, children)\n }\n });\n}","map":null,"metadata":{},"sourceType":"module"}
0 commit comments