Improve note preview and editor padding
- Increased editor padding from 6 to 8 for better spacing - Simplified preview generation to show first 100 characters - Remove markdown syntax (#, *, `) from note previews for cleaner display - Replaced multi-line filtering logic with direct substring approach
This commit is contained in:
@@ -44,7 +44,7 @@ export function NoteEditor({ note, onUpdateNote, fontSize, onUnsavedChanges }: N
|
|||||||
content: '',
|
content: '',
|
||||||
editorProps: {
|
editorProps: {
|
||||||
attributes: {
|
attributes: {
|
||||||
class: 'prose prose-slate max-w-none focus:outline-none p-6',
|
class: 'prose prose-slate max-w-none focus:outline-none p-8',
|
||||||
style: `font-size: ${fontSize}px`,
|
style: `font-size: ${fontSize}px`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -80,8 +80,10 @@ export function NotesList({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getPreview = (content: string) => {
|
const getPreview = (content: string) => {
|
||||||
const lines = content.split('\n').filter(l => l.trim());
|
// grab first 100 characters of note's content, remove markdown syntax from the preview
|
||||||
return lines.slice(1, 3).join(' ').substring(0, 100);
|
const previewContent = content.substring(0, 100);
|
||||||
|
const cleanedPreview = previewContent.replace(/[#*`]/g, '');
|
||||||
|
return cleanedPreview;
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user