🐛 fix: Fix highlight trim

pull/472/head
canisminor1990 2023-11-27 15:53:04 +08:00
parent ef5c03e3ac
commit c701c9f429
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -78,7 +78,7 @@ const App = memo<AppProps>(({ parentId }) => {
style={{ height: size?.height, width: handlePromptResize() }}
>
<SyntaxHighlighter language="prompt" options={options}>
{prompt.trim()}
{prompt}
</SyntaxHighlighter>
</div>
);

View File

@ -175,13 +175,13 @@ export const Converter = {
let inBracket = false;
for (let index = 0; index < string__.length; index++) {
if (string__[index] === ',' && !inBracket) {
array.push(string__.slice(start, index).trim());
array.push(string__.slice(start, index));
start = index + 1;
} else if (bracketRegex.test(string__[index])) {
inBracket = !inBracket;
}
}
array.push(string__.slice(Math.max(0, start)).trim());
array.push(string__.slice(Math.max(0, start)));
return array;
};