import { Component, useRef } from 'react'; import { Input } from 'antd'; import { Button, Flex } from 'antd'; // import Taro from "@tarojs/taro"; // import { // View, // Text, // Image, // Button, // Input, // Editor, // Textarea, // } from "@tarojs/components"; // import './APP.scss'; import styles from './App.module.scss'; // import { AtTabBar } from "taro-ui"; import React, { useCallback, useEffect, useState } from 'react'; // import { AtGrid } from "taro-ui"; // import { Swiper, SwiperItem } from "@tarojs/components"; // import { AtCard } from "taro-ui"; // import { AtImagePicker } from "taro-ui"; // import { AtButton } from "taro-ui"; // import { AtSearchBar } from "taro-ui"; // import { Picker } from "@tarojs/components"; // import { AtList, AtListItem } from "taro-ui"; // import { AtNavBar } from "taro-ui"; // import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui"; // import { AtToast } from "taro-ui"; // import { AtIcon } from "taro-ui"; import see from '../../images/see.png'; import group from '../../images/group.png'; import { marked } from 'marked'; // import _ from "lodash"; import OriginMark from './conpoments/OriginMark/index'; import TextArea from 'antd/es/input/TextArea'; // marked.use(`marked-code-jsx-renderer`); // marked.use(`marked-extended-tables`); //  marked.setOptions({ breaks: true, // 是否回车换行 gfm: true, //使用经批准的 GitHub Flavored Markdown (GFM) 规范 // pedantic: true, //严格模式 // highlight(code:any, lang:any) { // // 语法高亮 // let val = code; // if (lang) { // val = hljs.highlight(lang, code).value; // } else { // val = hljs.highlightAuto(code).value; // } // return val; // }, }); // 符号 // 🔥❓👉 // 0️⃣1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣7️⃣8️⃣9️⃣🔟 // ©️⭐🔍〰️➖ // 修改 marked 的解析规则 // const block = marked.Lexer.rules.block; // block.gfm.hr = /^( *[-*_]){3,} *(?:\n+|$)/; // 自定义水平线规则,确保它们在文档中被正确识别 // block.gfm.hr = // /^ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/; const renderer = new marked.Renderer(); // const originRenderer = _.cloneDeep(renderer); // 图片调整300px renderer.image = function (href, title, text) { // console.log("href, title, text", href, title, text); //
(.*?)<\/p>/; var regex = /
${text}
\n`; // return `${text}
`; return `