Skip to content

Commit

Permalink
优化Markdown编辑器样式,为图表和卡片添加上下边距
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jan 11, 2025
1 parent dfabbe6 commit dc23ce8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/MarkdownEditor/editor/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ const genStyle: GenerateStyle<ChatTokenType> = (token) => {
'[data-be]:not(p)': {
position: 'relative',
},
'[data-be="chart"]': {
marginTop: '0.5em',
marginBottom: '0.5em',
},
'[data-be="card"]': {
marginTop: '0.5em',
marginBottom: '0.5em',
},
'& &-inline-code': {
display: 'inline',
backgroundColor: '#0000000f',
Expand Down
5 changes: 3 additions & 2 deletions src/MarkdownEditor/editor/tools/Leading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ export const TocHeading = observer(({ note }: { note: IEditor }) => {
}, [note]);

useEffect(() => {
console.log('clear', note);
cache.clear();
getHeading();
setState({ active: '' });
}, [store?.container, note]);
}, [store?.container, note.schema]);

useDebounce(getHeading, 100, [note]);
useDebounce(getHeading, 100, [note.schema]);

useEffect(() => {
const div = box.current;
Expand Down

1 comment on commit dc23ce8

@vercel
Copy link

@vercel vercel bot commented on dc23ce8 Jan 11, 2025

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.