2727 </q-item >
2828
2929 <q-item
30- v-if =" note.react.notes.length > 0"
3130 clickable
3231 @click =" copyAsMarkdown({ includeDescendants: true })"
3332 >
5655 </q-item >
5756
5857 <q-item
59- v-if =" note.react.notes.length > 0"
6058 clickable
6159 @click =" downloadAsMarkdown({ includeDescendants: true })"
6260 >
@@ -88,7 +86,24 @@ import type { Ref } from 'vue';
8886
8987const page = inject <Ref <Page >>(' page' )! ;
9088
91- const note = computed (() => page .value .activeElem .react .value as PageNote );
89+ function notesToMarkdown(
90+ notes : PageNote [],
91+ params : {
92+ includeDescendants: boolean ;
93+ },
94+ ) {
95+ let markdown = ' ' ;
96+
97+ for (const [noteIndex, note] of notes .entries ()) {
98+ if (noteIndex > 0 ) {
99+ markdown += ' \n\n ---\n\n ' ;
100+ }
101+
102+ markdown += noteToMarkdown (note , params );
103+ }
104+
105+ return markdown ;
106+ }
92107
93108function noteToMarkdown(
94109 note : PageNote ,
@@ -179,7 +194,7 @@ function editorToMarkdown(editor: Editor) {
179194
180195async function copyAsMarkdown(params : { includeDescendants: boolean }) {
181196 await setClipboardText (
182- noteToMarkdown ( note .value , {
197+ notesToMarkdown ( page .value . selection . react . notes , {
183198 includeDescendants: params .includeDescendants ,
184199 }),
185200 );
@@ -194,7 +209,7 @@ async function downloadAsMarkdown(params: { includeDescendants: boolean }) {
194209 try {
195210 const blob = new Blob (
196211 [
197- noteToMarkdown ( note .value , {
212+ notesToMarkdown ( page .value . selection . react . notes , {
198213 includeDescendants: params .includeDescendants ,
199214 }),
200215 ],
0 commit comments