First Release of Claw3D (#11)
Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export const normalizeAssistantDisplayText = (value: string): string => {
|
||||
const lines = value.replace(/\r\n?/g, "\n").split("\n");
|
||||
const normalized: string[] = [];
|
||||
let lastWasBlank = false;
|
||||
for (const rawLine of lines) {
|
||||
const line = rawLine.replace(/[ \t]+$/g, "");
|
||||
if (line.trim().length === 0) {
|
||||
if (lastWasBlank) continue;
|
||||
normalized.push("");
|
||||
lastWasBlank = true;
|
||||
continue;
|
||||
}
|
||||
normalized.push(line);
|
||||
lastWasBlank = false;
|
||||
}
|
||||
return normalized.join("\n").trim();
|
||||
};
|
||||
Reference in New Issue
Block a user