Warning: This post will probably be to wide, until the bug is fixed. That's on purpose, it is precisely what this post is about.

Looking at Re^2: Change readonly status of Win32::GUI::RichEdit, I was wondering why the article is so wide in Firefox. (It would seem to be rather normal in MSIE, but that is only because MSIE can wrap text where there is no whitespace, for example, right after a hyphen.) It's that first code snippet, over 160 characters long, that is to blame. It just doesn't wrap.

In case you don't see it like I do, here's a screenshot (for a few weeks, at least).

Apparently, code that doesn't contain a newline, doesn't wrap. See for yourself:

$mainform->tab->Page4->AddRichEdit(-name=>'articletext',-style=>WS_VISIBLE|WS_VSCROLL,-multiline=>1,-text=>"",-width=>745,-height=>450,-left=>10,-top=>35,-readonly=>1);

Inserting a newline anywhere in the code, allows the code wrapper to kick in:

Newline inserted at the front:

$mainform->tab->Page4->AddRichEdit(-name=>'articletext',-style=>WS_VIS +IBLE|WS_VSCROLL,-multiline=>1,-text=>"",-width=>745,-height=>450,-lef +t=>10,-top=>35,-readonly=>1);

Newline appended at the end:
$mainform->tab->Page4->AddRichEdit(-name=>'articletext',-style=>WS_VISIBLE|WS_VSCROLL,-multiline=>1,-text=>"",-width=>745,-height=>450,-left=>10,-top=>35,-readonly=>1);

Two lines of code with just a newline between them, but nowhere else:

$mainform->tab->Page4->AddRichEdit(-name=>'articletext',-style=>WS_VIS +IBLE|WS_VSCROLL,-multiline=>1,-text=>"",-width=>745,-height=>450,-lef +t=>10,-top=>35,-readonly=>1); $mainform->tab->Page4->AddRichEdit(-name=>'articletext',-style=>WS_VIS +IBLE|WS_VSCROLL,-multiline=>1,-text=>"",-width=>745,-height=>450,-lef +t=>10,-top=>35,-readonly=>1);

Note that that is all I changed.

Update: Some people don't seem to get what I'm driving at. I think this is a bug. No node with code should ever act like that.

Update: In case your browser/user settings are vastly different than mine, here's a screenshot of this post, showing both what I find normal and not normal.


In reply to code without newline doesn't wrap by bart

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.