Skip to content

Commit

Permalink
🐛 fix: Fix highlight trim
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Nov 27, 2023
1 parent ef5c03e commit c701c9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions javascript/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/modules/PromptHighlight/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/formatPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit c701c9f

Please sign in to comment.