fix formatting of script output (#15757)

relates to #15515

fix the formatting of the script output by replacing the `\r` characters
with `\n` characters.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [x] Manual QA for all new/changed functionality
This commit is contained in:
Gabriel Hernandez
2023-12-21 11:17:03 -06:00
committed by GitHub
parent 02c621927b
commit d35879944a
2 changed files with 8 additions and 0 deletions
@@ -0,0 +1 @@
- improve script output text formatting.
@@ -10,6 +10,13 @@ interface ITextareaProps {
// A textarea component that encapsulates common styles and functionality.
const Textarea = ({ children, className }: ITextareaProps) => {
// this is to preserve line breaks when we encounter a carriage return character.
// We could not find a way to preserve line breaks in the CSS alone for this
// character.
if (typeof children === "string") {
children = children.replace(/\r/g, "\n");
}
const classNames = classnames(baseClass, className);
return <div className={classNames}>{children}</div>;
};