X
Tap here to go to the mobile version of the site.

Support Forum

Can't copy batch file code from website.

Posted

If I try to copy a batch file from a [code] block on the 'steam guides' website, the resulting paste is missing returns.

https://support.cdn.mozilla.net/media/uploads/images/2017-12-05-08-08-00-cf81bc.png

If I try to copy a batch file from a [code] block on the 'steam guides' website, the resulting paste is missing returns. https://support.cdn.mozilla.net/media/uploads/images/2017-12-05-08-08-00-cf81bc.png
Attached screenshots

Chosen solution

Try to use View Selection Source in the right-click context menu of the selected text. You can also use the Inspector to add <pre>TEXT</pre> tags around the text (right-click: Edit as HTML).

Read this answer in context 1

Additional System Details

Installed Plug-ins

  • Shockwave Flash 26.0 r0

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0

More Information

Mkll 314 solutions 1978 answers

Hello, if you are copying the raw paste data, you will have to add the returns yourself, and it should work as expected. This goes for all web browsers -- not just Firefox.

Hello, if you are copying the raw paste data, you will have to add the returns yourself, and it should work as expected. This goes for all web browsers -- not just Firefox.

Question owner

No, if I try microsoft's or google's competition browsers i do get the expected result.

You can try for yourself here: http://steamcommunity.com/sharedfiles/filedetails/?id=1173862256

No, if I try microsoft's or google's competition browsers i do get the expected result. You can try for yourself here: http://steamcommunity.com/sharedfiles/filedetails/?id=1173862256
Mkll 314 solutions 1978 answers

Strange, try copying and pasting again but paste the raw data into a pastebin and copy from there.

Strange, try copying and pasting again but paste the raw data into a pastebin and copy from there.

Question owner

Nope, doesn't work either, if I look with the 'inspector' function it's already stripped of returns there, so if I paste into pastebin it's the same soup as it is in a notepad file. I don't get why it stopped working since 57.0, it used to work before.

Nope, doesn't work either, if I look with the 'inspector' function it's already stripped of returns there, so if I paste into pastebin it's the same soup as it is in a notepad file. I don't get why it stopped working since 57.0, it used to work before.
Mkll 314 solutions 1978 answers

File a bug at https://bugzilla.mozilla.org -- Once there you will need to create an account. When registered, please see the documentation for bug filing to help get you started.

File a bug at https://bugzilla.mozilla.org -- Once there you will need to create an account. When registered, please see the documentation for bug filing to help get you started.

Question owner

Okay, I filed a bug .

thanks

Okay, I filed a bug . thanks
Mkll 314 solutions 1978 answers

Helpful Reply

If my response helped you, mark as solution.

If my response helped you, mark as solution.
cor-el
  • Top 10 Contributor
  • Moderator
16992 solutions 153425 answers

Chosen Solution

Try to use View Selection Source in the right-click context menu of the selected text. You can also use the Inspector to add <pre>TEXT</pre> tags around the text (right-click: Edit as HTML).

Try to use View Selection Source in the right-click context menu of the selected text. You can also use the Inspector to add &lt;pre&gt;TEXT&lt;/pre&gt; tags around the text (right-click: Edit as HTML).

Question owner

'View selection source' worked! I could copy it normally then. Same when edit as html is used in inspector.

I marked your answer as a solution, but I still don't understand why I should be this complicated. It used to work with a simple select/copy/paste action, as it does in any other browser I tested except the firefox 57.0(.1) browsers.

'View selection source' worked! I could copy it normally then. Same when edit as html is used in inspector. I marked your answer as a solution, but I still don't understand why I should be this complicated. It used to work with a simple select/copy/paste action, as it does in any other browser I tested except the firefox 57.0(.1) browsers.
cor-el
  • Top 10 Contributor
  • Moderator
16992 solutions 153425 answers

It has to do with what Firefox places on the clipboard.

If I use the text/html flavor on the clipboard then it works and it preserves the linefeed characters.

@echo off
cls
rem *** main script starts, set window title ***
rem --------------------------------------------

If I use text/unicode flavor on the clipboard then it doesn't work.

@echo off cls rem *** main script starts, set window title *** rem --------------------------------------------

Text/unicode seems to place whitespace on the clipboard formatted as HTML and converts linefeed to spaces (a <br> would be converted to a linefeed).

It has to do with what Firefox places on the clipboard. If I use the text/html flavor on the clipboard then it works and it preserves the linefeed characters. <pre><nowiki>@echo off cls rem *** main script starts, set window title *** rem --------------------------------------------</nowiki></pre> If I use text/unicode flavor on the clipboard then it doesn't work. <pre><nowiki>@echo off cls rem *** main script starts, set window title *** rem --------------------------------------------</nowiki></pre> Text/unicode seems to place whitespace on the clipboard formatted as HTML and converts linefeed to spaces (a &lt;br&gt; would be converted to a linefeed).

Question owner

Yeah, I've found that out too now. I still don't get why firefox 57 would handle this different from other browsers and i's own predecessors.

If this is how it should be, then I kind of expect an option where I right-click to copy, like 'copy as html' and 'copy as unicode'. Like it is now, I feel it's over complicated to get the desired result. Maybe not for me but for an average user it is.

Anyway thanks to all trying and explaining what's going on!

Yeah, I've found that out too now. I still don't get why firefox 57 would handle this different from other browsers and i's own predecessors. If this is how it should be, then I kind of expect an option where I right-click to copy, like 'copy as html' and 'copy as unicode'. Like it is now, I feel it's over complicated to get the desired result. Maybe not for me but for an average user it is. Anyway thanks to all trying and explaining what's going on!