()
| 145 | } |
| 146 | |
| 147 | async function exportMarkdown() { |
| 148 | const content = Array.from(document.querySelectorAll('main .items-center>div')).map(i => { |
| 149 | let j = i.cloneNode(true); |
| 150 | if (/dark\:bg-gray-800/.test(i.getAttribute('class'))) { |
| 151 | j.innerHTML = `<blockquote>${i.innerHTML}</blockquote>`; |
| 152 | } |
| 153 | return j.innerHTML; |
| 154 | }).join(''); |
| 155 | const data = ExportMD.turndown(content); |
| 156 | const { id, filename } = getName(); |
| 157 | await invoke('save_file', { name: `notes/${id}.md`, content: data }); |
| 158 | await invoke('download_list', { pathname: 'chat.notes.json', filename, id, dir: 'notes' }); |
| 159 | } |
| 160 | |
| 161 | function downloadThread({ as = Format.PNG } = {}) { |
| 162 | const elements = new Elements(); |
no test coverage detected