MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / exportMarkdown

Function exportMarkdown

ChatGPT/src-tauri/src/scripts/export.js:147–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

addActionsButtonsFunction · 0.85

Calls 2

getNameFunction · 0.85
invokeFunction · 0.85

Tested by

no test coverage detected