first commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export function parseImagePromptFromContent(content) {
|
||||
if (!content || !content.includes('[IMAGE_PROMPT:')) return { text: content, prompt: null };
|
||||
const match = content.match(/\[IMAGE_PROMPT:(.*?)\]/s);
|
||||
const prompt = match ? match[1].trim() : null;
|
||||
const text = content.replace(/\[IMAGE_PROMPT:.*?\]/gs, '').trim();
|
||||
return { text, prompt };
|
||||
}
|
||||
|
||||
export async function copyToClipboard(text) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user