Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

While working on something else, I realized that I could make <code> tags automatically wrap code to (roughly) fit your window. So you can now go to user settings and check the "Auto Code Wrap" option and any stuff inside of <code> tags will be rendered such that your browser will wrap it to fit. So if the code is hard to read because it is wrapped too much, just widen your browser window.

If someone puts a really long string without spaces inside of <code> tags, then your browser won't wrap in the middle of this really long string. This is a pain, so if you have "Auto Code Wrap" checked and you also enter a number (say "20") in "Code Wrap Length" (leaving it blank doesn't default to "70" in this case), then we'll insert a red soft hyphen after each run of 20 non-space characters. These will be invisible (on a conforming browser) unless your browser decides to wrap the code at that point.

You can also now enter a "Code Prefix" which will be prepended to each line of code displayed. If you include a run of digits something matching /&\d+;/ in this prefix, then those digits will be incremented for each line of code. So you can use a prefix of, for example, "&001;:&nbsp;" to have all lines of code numbered. Note that &#8226; includes a bullet while &8226; would start numbering lines at 8226.

Note that "Code Wrapping Off" overrides all of these settings.

Also, if you have "Auto Code Wrap" checked (and no Code Prefix defined), you might be tempted to skip the "d/l code" link and just cut'n'paste the code directly. However, if you've entered a number for Code Wrap Length and that code has any strings of non-space characters that long or longer, then you'll get some soft hyphens included (even though they might be invisible) which will break the code.

I've tested things quite a bit but there were a lot of changes involved and some browsers may not like the red soft hyphens (if so, then either don't check Auto Code Wrap or set Code Wrap Length to be empty)...

If you'd like to test your new settings, try Re: Space or Soft Hyphens (see code wrap).

        - tye (but my friends call me "Tye")

In reply to New code wrap options by tye

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found