Skip to content

Commit

Permalink
修复 Markdown 编辑器中的文本替换逻辑,优化对特定字符的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Dec 12, 2024
1 parent 07436bb commit c5daaf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/MarkdownEditor/editor/elements/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export const MLeaf = (
>
{!!dirty && !!leaf.text && <InlineChromiumBugfix />}
{leaf.fnc || leaf.identifier
? leaf.text?.replaceAll('[^', '').replaceAll(']', '')
? leaf.text?.replaceAll(']', '')?.replaceAll('[^DOC_', '')
: children}
{!!dirty && !!leaf.text && <InlineChromiumBugfix />}
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/MarkdownEditor/editor/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const genStyle: GenerateStyle<ChatTokenType> = (token) => {
border: '0.4px solid #E6ECF4',
fontSize: '12px',
fontWeight: 600,
height: '14px',
minWidth: '14px',
height: '16px',
minWidth: '16px',
margin: '0 2px',
lineHeight: '14px',
textAlign: 'center',
Expand Down

1 comment on commit c5daaf1

@vercel
Copy link

@vercel vercel bot commented on c5daaf1 Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.