fixed:
x=$(xclip -sel clipboard -o)
x=$(echo "$x" | tr -s '\n')
x=$(echo "$x" | sed '/-$/N;s/-\n//')
x=$(echo "$x" | tr '\n' ' ')
x=$(echo "$x" | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
x=$(echo "$x" | tr -s ' ')
echo -n "$x" | xclip -sel clipboard
gemini trust broken, gpt is my new best friend