Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

problem with formatting

by dunc (Initiate)
on Apr 02, 2003 at 12:28 UTC ( #247474=monkdiscuss: print w/replies, xml ) Need Help??

why does your code insist on putting ­ tags throughout all the code examples in this site. IE is picking up this ascii character and when i paste examples into a text editor its leaving it in. which as its a non-visible ascii character, doesnt show up in my text editors. then when i try and run the code, perl dies because of the wierd characters (Unrecognized character \xAD at...). im having to run my cut and pasted code through a lot of search and replaces to strip out all the shy tags. cant you stop them from being included into the code or is this a "feature"? sorry if this isnt really perl related, but i cant seem to find anywhere to ask questions about this engine

Replies are listed 'Best First'.
Re: problem with formatting
by Corion (Patriarch) on Apr 02, 2003 at 12:42 UTC

    The code is also not meant to be cut'n'pasted, as there is automagic line wrapping. On all pages with code (or rather, with CODE tags) there is a link d/l code, which allows you to download all the code directly.

    The Perlmonks website runs on the Everything Engine (or rather, a heavily modified version of it), and a link on the bottom of the pages brings you to the homepage of it.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: problem with formatting
by dakkar (Hermit) on Apr 02, 2003 at 12:43 UTC

    Use the "d/l code" link.

    Don't copy the code from the body of the node.

    What is sent as part of the body of the node is the presentation of the code, not the code itself.

            dakkar - Mobilis in mobile
      It'd be lovely to have that "d/l code" feature available for scratchpads as well. (/me ducks)
Re: problem with formatting (thepen)
by tye (Sage) on Apr 02, 2003 at 21:31 UTC

    Note that the original pages such as also have "d/l code" links. They might be harder to notice because thepen has chosen to disable the normal underlining of links so we don't have any visual cue that there is a link there. They are also in the middle a very long page (just like they are in the local copy of the thread, Beast of the Number: Parsing the Feral Phone), which adds to the difficulty. I've never understood the desire to remove the visual cue for the location of links and I think this demonstrates why that can be a bad idea.

    I've also /msg'd blakem, who graciously set up and maintains the thepen mirror (in part so that Google doesn't index chatterbox conversations -- yes, there are other ways to accomplish this but thepen is working and the alternatives still aren't, yet), asking that he not use the "autowrap" feature as it doesn't work on any browser I've heard tested other than IE. It appears that recent versions of IE are the only browsers that know how to display optional hyphens correctly.

    For thepen, I'd personally prefer "old-style" code wrapping with a fairly wide setting (like 120) since there aren't any nodelets and it makes cut'n'paste likely to work most of the time (since those browsing via thepen are likely to not be as familiar with PerlMonks and realize that cut'n'paste is not the best way to grab code).

                    - tye
Re: problem with formatting
by Mr_Person (Hermit) on Apr 02, 2003 at 15:48 UTC
    There is more information on this feature at New code wrap options. Basically, soft hypens are inserted to keep long lines within <code> tags from making the page really wide on your webrowser. Apparently thepen has this option turned on for their mirror. If you log in on the main site, you can change this at your user settings page as detailed in the first link. Or click the download code link at the bottom of the post.
Re: problem with formatting
by Tomte (Priest) on Apr 02, 2003 at 12:32 UTC

    I for one don't understand your problem...
    I can download code just fine, I just have to strip the \r's out, nothing more...and on windows you wouldn't even have to do that, IIRC...


      ok well heres an example:

      this is the code i found this problem with. i dont "download" the code, i cut and paste it from the yellow tables. when i cut and paste the &shy; characters seem to be picked up, but converted into ASCII codes, and inserted into the documents when i save them in a text editor.

      if you view the source of that page and search for &shy; you will see how many of them there are. why are they in there? did the person who submitted that example add them or did the engine?

      i tried with another example and found the same problem:

      thanks for the quick reply by the way...


      Edit by tye, make URL into links

        The links you have posted are from the search engine friendly version of the site. You shouldn't really be using that for the code but grabbing the stuff from the .org site.

        Could you indicate whether your problem is on this actual site?
      Tomte, FWIW, you are correct about Windows. I was able to copy and paste the text from that page into Notepad without any &shy; characters showing up. Of course downloading from the .org site is preferable...

      Studying at the feet of the masters

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://247474]
Approved by broquaint
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2022-06-27 20:24 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (88 votes). Check out past polls.