From f4e337647df8d53c3a78d91f37c59a50e18a3ee2 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sat, 11 Jun 2022 09:44:22 +0800 Subject: [PATCH 1/3] type: optimization type. (#188) --- src/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 579e7fd5..3422f6d3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,6 @@ import React, { useImperativeHandle } from 'react'; import ReactMarkdown, { Options } from 'react-markdown'; -import { Root, Element, ElementContent } from 'hast'; +import { Element } from 'hast'; import { PluggableList } from 'unified'; import gfm from 'remark-gfm'; import slug from 'rehype-slug'; @@ -8,7 +8,7 @@ import headings from 'rehype-autolink-headings'; import rehypeRaw from 'rehype-raw'; import rehypeAttrs from 'rehype-attr'; import rehypePrism from 'rehype-prism-plus'; -import rehypeRewrite, { getCodeString } from 'rehype-rewrite'; +import rehypeRewrite, { getCodeString, RehypeRewriteOptions } from 'rehype-rewrite'; import { octiconLink } from './nodes/octiconLink'; import { copyElement } from './nodes/copy'; import './styles/markdown.less'; @@ -50,7 +50,7 @@ export default React.forwardRef((props useImperativeHandle(ref, () => ({ ...props, mdp }), [mdp, props]); const cls = `${prefixCls || ''} ${className || ''}`; - const rehypeRewriteHandle = (node: ElementContent, index: number | null, parent: Root | Element | null) => { + const rehypeRewriteHandle: RehypeRewriteOptions['rewrite'] = (node, index, parent) => { if (node.type === 'element' && parent && parent.type === 'root' && /h(1|2|3|4|5|6)/.test(node.tagName)) { const child = node.children && (node.children[0] as Element); if (child && child.properties && child.properties.ariaHidden === 'true') { From 5fcbffeb1729fc5f580ab21e5b72d17d51f24c50 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sun, 12 Jun 2022 18:19:44 +0800 Subject: [PATCH 2/3] style: modify input checkbox style. --- src/styles/markdown.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/styles/markdown.less b/src/styles/markdown.less index 28a0e201..36497af3 100644 --- a/src/styles/markdown.less +++ b/src/styles/markdown.less @@ -982,8 +982,7 @@ body[data-color-mode*='light'] { display: none; } } - .task-list-item-checkbox, - input[type='checkbox'] { + .task-list-item-checkbox { margin: 0 0.2em 0.25em -1.6em; vertical-align: middle; } From 1d9e520034b2f39856230d43a4301a34d0f81a36 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sun, 12 Jun 2022 18:20:19 +0800 Subject: [PATCH 3/3] released v4.0.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cd2d7f77..d7b1f8cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-markdown-preview", - "version": "4.0.16", + "version": "4.0.17", "description": "React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style.", "homepage": "https://uiwjs.github.io/react-markdown-preview", "main": "lib/index.js",