MCPcopy Create free account
hub / github.com/danja/dogalog / extractCodeFromMessage

Method extractCodeFromMessage

src/ui/aiChat.js:204–211  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

202 }
203
204 extractCodeFromMessage(message) {
205 if (!message || typeof message !== 'string') return { text: message, code: '' };
206 const match = message.match(/```(?:[a-zA-Z]*)\s*([\s\S]*?)```/);
207 if (!match) return { text: message, code: '' };
208 const code = match[1].trim();
209 const text = message.replace(match[0], '').trim();
210 return { text, code };
211 }
212}

Callers 1

sendMethod · 0.95

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected