Skip to content

Commit

Permalink
fix(custom mode): remove space at beginning of custom text lines (@no…
Browse files Browse the repository at this point in the history
…tTamion) (#5993)

when creating a multi line text in the custom text editor and then
reopening the editor all lines after the first will have a space at the
start, this is because .join adds a space regardless of whether there is
a newline character
  • Loading branch information
notTamion authored Nov 4, 2024
1 parent d4e14da commit ab7cf0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/ts/modals/custom-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ async function afterAnimation(): Promise<void> {
}

export function show(showOptions?: ShowOptions): void {
state.textarea = CustomText.getText().join(
CustomText.getPipeDelimiter() ? "|" : " "
);
state.textarea = CustomText.getText()
.join(CustomText.getPipeDelimiter() ? "|" : " ")
.replace(/^ +/gm, "");
void modal.show({
...(showOptions as ShowOptions<IncomingData>),
beforeAnimation,
Expand Down

0 comments on commit ab7cf0b

Please sign in to comment.