ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Special User Sections > Site/Forum Features

Ability to copy geshi formatted code text.. help me test?

(1/5) > >>

mouser:
Can anyone help me test the new ability to copy the text of geshi syntax highlighted text?

Normal attempts to select and copy geshi syntax highlighted text results in garbage that is impossible to reuse outside the forum.

I've added a new copy/print link at the top of geshi syntax highlighted code which should pop up a plain text window to copy from -- let's see if it works -- let me know.

here is a SAMPLE CODE BLOCK to test out the copy function on:

--- Code: PHP ---$entries = array();        $total_t = 0;        $total_s = 0;        foreach ($cache_hits as $h)                {                $entries[] = $h['d'] . ' ' . $h['k'] . ': ' . comma_format($h['t'], 5) . ' - ' . $h['s'] . ' bytes';                $total_t += $h['t'];                $total_s += $h['s'];                }

mouser:
note: you may have to do a ctrl+refresh of the page in order to force the forum to reload the latest javascript code on the site instead of using cache.

argv:
It seems to work fine doing paste in Notepad++, just the formating is lost; is this what you wanted to test?

   1.
      $entries = array();
   2.
      $total_t = 0;
   3.
      $total_s = 0;
   4.
      foreach ($cache_hits as $h)
   5.
      {
   6.
      $entries[] = $h['d'] . ' ' . $h['k'] . ': ' . comma_format($h['t'], 5) . ' - ' . $h['s'] . ' bytes';
   7.
      $total_t += $h['t'];
   8.
      $total_s += $h['s'];
   9.
      }

mouser:
those messed up numbers demonstrate the problem with normal select and copy.
try clicking on the link that says "[copy or print]" to see a new window popup with clean plain text you can copy properly -- that's the new thing.

argv:
It's better:

$entries = array();
   $total_t = 0;
   $total_s = 0;
   foreach ($cache_hits as $h)
      {
      $entries[] = $h['d'] . ' ' . $h['k'] . ': ' . comma_format($h['t'], 5) . ' - ' . $h['s'] . ' bytes';
      $total_t += $h['t'];
      $total_s += $h['s'];
      }

Navigation

[0] Message Index

[#] Next page

Go to full version