Skip to content

Commit 5470dff

Browse files
committed
chore: use remark-github-blockquote-alert plugin. #258
1 parent 373d332 commit 5470dff

File tree

5 files changed

+7
-116
lines changed

5 files changed

+7
-116
lines changed

core/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,6 @@ import React from 'react';
617617
import MarkdownPreview from '@uiw/react-markdown-preview';
618618

619619
const source = `>
620-
>
621-
> Useful information that users should know, even when skimming content.
622-
623620
>
624621
> [!NOTE]
625622
> Useful information that users should know, even when skimming content.

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"rehype-rewrite": "~4.0.0",
6767
"rehype-slug": "~6.0.0",
6868
"remark-gfm": "~4.0.0",
69-
"remark-github-beta-blockquote-admonitions": "^3.1.1",
69+
"remark-github-blockquote-alert": "^1.0.0",
7070
"unist-util-visit": "^5.0.0"
7171
}
7272
}

core/src/plugins/remarkAlert.ts

Lines changed: 0 additions & 109 deletions
This file was deleted.

core/src/preview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import ReactMarkdown, { type UrlTransform } from 'react-markdown';
33
import { type PluggableList } from 'unified';
44
import gfm from 'remark-gfm';
55
import raw from 'rehype-raw';
6+
import { remarkAlert } from 'remark-github-blockquote-alert';
67
import { useCopied } from './plugins/useCopied';
7-
import { remarkAlert } from './plugins/remarkAlert';
88
import { type MarkdownPreviewProps, type MarkdownPreviewRef } from './Props';
99
import './styles/markdown.less';
1010

@@ -34,7 +34,7 @@ export default React.forwardRef<MarkdownPreviewRef, MarkdownPreviewProps>((props
3434
useImperativeHandle(ref, () => ({ ...props, mdp }), [mdp, props]);
3535
const cls = `${prefixCls || ''} ${className || ''}`;
3636
useCopied(mdp);
37-
const rehypePlugins: PluggableList = [[remarkAlert], ...(other.rehypePlugins || [])];
37+
const rehypePlugins: PluggableList = [...(other.rehypePlugins || [])];
3838
const customProps: MarkdownPreviewProps = {
3939
allowElement: (element, index, parent) => {
4040
if (other.allowElement) {
@@ -46,7 +46,7 @@ export default React.forwardRef<MarkdownPreviewRef, MarkdownPreviewProps>((props
4646
if (skipHtml) {
4747
rehypePlugins.push(raw);
4848
}
49-
const remarkPlugins = [...(other.remarkPlugins || []), gfm];
49+
const remarkPlugins = [remarkAlert, ...(other.remarkPlugins || []), gfm];
5050
const wrapperProps = { ...warpperElement, ...wrapperElement };
5151
return (
5252
<div ref={mdp} onScroll={onScroll} onMouseOver={onMouseOver} {...wrapperProps} className={cls} style={style}>

core/src/styles/markdown.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,9 @@ body[data-color-mode*='light'] {
10801080
display: flex;
10811081
align-items: center;
10821082
line-height: 1;
1083+
font-weight: 600;
1084+
font-family: initial;
1085+
font-size: 14px;
10831086
svg.octicon {
10841087
margin-right: var(--base-size-8, 8px) !important;
10851088
}

0 commit comments

Comments
 (0)