Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Comment on

( #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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (3)
    As of 2014-09-20 23:44 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (164 votes), past polls