Forum messing up pasted code

Hi,

Recently, I have received feedback from fellow forum members that what I have pasted looks incorrect when viewed on the web forum.

That seems something new, as it has not happened in the past.

2 Likes

It’s also incorrect in generated emails.

I dont think it is new and I have commented on it in the past. I dont
know if it only affects users who post via email: it has affected me.
It should be absolutely prohibited for discourse to mess with text
inside code fences, and this would be a major bug if so. I dont know if
we can find a simple case. Here’s a pipe:

ps aux | grep qubes
I never presume to speak for the Qubes team. When I comment in the Forum I speak for myself.
1 Like

It looks as if this may be an artifact from Qubes copy/paste - if I copy a
pipe with standard inter qube copy/paste it is not pasted as a pipe -
sanitised?

@qubist - check to see what you actually posted.

I never presume to speak for the Qubes team. When I comment in the Forum I speak for myself.
1 Like

I can’t reproduce this. I just copy-pasted this between qubes successfully, without any issues:

echo asd | grep a
2 Likes

Does it depend on the terminal in use and also, how the clipboard is
populated? (eg Xterm, selectToClipboard? vi ? ). Many variables.

I never presume to speak for the Qubes team. When I comment in the Forum I speak for myself.
1 Like

@unman

This is the message body source from my mail client:

https://paste.opensuse.org/pastes/bc2b07cda4fd

And the second one:

https://paste.opensuse.org/pastes/a34b5ce4d985

1 Like

@unman

Does it depend on the terminal in use and also, how the clipboard is
populated? (eg Xterm, selectToClipboard? vi ? ).

I don’t think so. Otherwise the message in the mail client and in susepaste would be messed up to, which is not the case.

Test:

> hello

Should read as greater than hello

> hello

Should read as vertical line before hello

Same with 4 spaces prefix:

    > hello
    > hello

Same with tab prefix:

	> hello
	> hello

Same with tab + 4 spaces prefix:

	    > hello
	    > hello
1 Like

OK, confirmed:

The forum converts leading vertical line to ‘>’, with or without empty space before it.

2 Likes

More testing:

eb4f84ef043db492c7d102bf7e357ee033[foo

Should read as backslash 033, left square bracket and ‘foo’.

1 Like

The second test reveals that the forum translates backslash into ‘eb4f84ef043db492c7d102bf7e357ee’.

Both tests were typed directly, nothing was pasted. That excludes Qubes clipboard.

1 Like

Also looking at my older posts containing bash source code, I don’t see such issue.

1 Like

I confirm @qubist observations.

It might be a discourse issue?

1 Like

@unman

P.S. all your fullstops, asterisks and brackets in this post are backslash escaped in the plaintext email message body:

https://paste.opensuse.org/pastes/34cdb120cd05

1 Like

What a strange and unwelcome bug!

1 Like

@unman

In your recent post each apostrophe shows as three question marks - in email and on the web page.

Could you please check if it may be due to your email client? Or maybe another forum bug?

1 Like

It was terminal settings on the machine I was on. I dont hear those marks, so they can slip by.

I never presume to speak for the Qubes team.
When I comment in the Forum I speak for myself.

1 Like

@unman

Thanks for the feedback.

1 Like