@uiw/react-md-editor 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mdeditor.js CHANGED
@@ -75355,7 +75355,7 @@ const rehype = unified().use(rehypeParse).use(rehypeStringify).freeze()
75355
75355
  ;// CONCATENATED MODULE: ./src/components/TextArea/Markdown.tsx
75356
75356
  // @ts-ignore
75357
75357
  function Markdown(props){var prefixCls=props.prefixCls;var _useContext=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(EditorContext),_useContext$markdown=_useContext.markdown,markdown=_useContext$markdown===void 0?'':_useContext$markdown,highlightEnable=_useContext.highlightEnable,dispatch=_useContext.dispatch;var preRef=/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(preRef.current&&dispatch){dispatch({textareaPre:preRef.current});}// eslint-disable-next-line react-hooks/exhaustive-deps
75358
- },[]);function html2Escape(sHtml){return sHtml.replace(/```(.*)\s+([\s\S]*?)(\s.+)?```/g,function(str){return str.replace(/[<>&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}).replace(/[<>&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){if(!highlightEnable||!markdown){return/*#__PURE__*/(0,jsx_runtime.jsx)("pre",{children:markdown||'',ref:preRef,className:"".concat(prefixCls,"-text-pre wmde-markdown-color")});}var str=rehype().data('settings',{fragment:true}).use((rehype_prism_default()),{ignoreMissing:true}).processSync("<pre class=\"language-markdown ".concat(prefixCls,"-text-pre wmde-markdown-color\"><code class=\"language-markdown\">").concat(html2Escape(markdown),"\n</code></pre>"));return/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement('div',{className:'wmde-markdown-color',dangerouslySetInnerHTML:{__html:str.value}});},[highlightEnable,markdown,preRef,prefixCls]);}
75358
+ },[]);function html2Escape(sHtml){return sHtml.replace(/```(tsx?|jsx?|html|xml)(.*)\s+([\s\S]*?)(\s.+)?```/g,function(str){return str.replace(/[<&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}).replace(/[<&"]/g,function(c){return{'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});}return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function(){if(!highlightEnable||!markdown){return/*#__PURE__*/(0,jsx_runtime.jsx)("pre",{children:markdown||'',ref:preRef,className:"".concat(prefixCls,"-text-pre wmde-markdown-color")});}var str=rehype().data('settings',{fragment:true}).use((rehype_prism_default()),{ignoreMissing:true}).processSync("<pre class=\"language-markdown ".concat(prefixCls,"-text-pre wmde-markdown-color\"><code class=\"language-markdown\">").concat(html2Escape(markdown),"\n</code></pre>"));return/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement('div',{className:'wmde-markdown-color',dangerouslySetInnerHTML:{__html:str.value}});},[highlightEnable,markdown,preRef,prefixCls]);}
75359
75359
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
75360
75360
 
75361
75361
  function _arrayWithoutHoles(arr) {