Hi,

I was annoyed by the left border on pre sections being cut when it gets too long. So I changed the code and stylesheet to wrap it all inside a <div> tag which sets the border. It works on all browsers I have, and even removes the annoying white space between the pre sections, except on Opera.

Preview here:
http://users.skynet.be/pereinar/mod-perl/outstanding/success_stories/etoys.com.html


(before, the border would break just after
capacity planning for Christmas 2000 was for three times the traffic
), and that's where I get a newline now on Opera.

Here's the patch, please tell me what you think before I commit:

Allan, will you make sure you incorporate the stylsheet changes into your current design work, to avoid conflicts when we merge?

Index: lib/DocSet/Doc/Common.pm
===================================================================
RCS file: /home/cvs/modperl-docs/lib/DocSet/Doc/Common.pm,v
retrieving revision 1.12
diff -u -r1.12 Common.pm
--- lib/DocSet/Doc/Common.pm    12 Jun 2002 02:53:46 -0000      1.12
+++ lib/DocSet/Doc/Common.pm    12 Jun 2002 20:04:45 -0000
@@ -157,11 +157,12 @@

     # if the <pre> section is too long ps2pdf fails to generate pdf,
     # so split it into 40 lines chunks.
-    my $result = '';
+    my $result = qq{<div class="pre-section">\n};
     while ($text =~ /((?:[^\n]*\n?){1,40})/sg) {
         next unless length($1); # skip empty matches
-        $result .= qq{<pre class="pre-section">$1</pre>\n};
+        $result .= qq{<pre class="pre-section">$1</pre>};
     }
+    $result .= qq{</div>\n};

     return $result;
 }
Index: src/style.css
===================================================================
RCS file: /home/cvs/modperl-docs/src/style.css,v
retrieving revision 1.70
diff -u -r1.70 style.css
--- src/style.css       14 May 2002 05:24:57 -0000      1.70
+++ src/style.css       12 Jun 2002 20:04:45 -0000
@@ -21,13 +21,20 @@
     font-size: 1.0em;
 }

-.pre-section {
-    font-family: courier new, courier, monospace;
-    font-size: 1.0em;
+div.pre-section {
     border-style: solid;
     border-width: 0px 0px 0px 1px;
-    white-space: pre;
     border-color: #004080; /* same color as quotation */
+}
+
+pre.pre-section {
+    font-family: courier new, courier, monospace;
+    font-size: 1.0em;
+    white-space: pre;
+    margin-top: 0px;
+    margin-bottom: 0px;
+    padding-top: 0px;
+    padding-bottom: 0px;
     /* width: 100%;  might be needed for konqueror?*/
 }


-- Per Einar Ellefsen [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to