How to Fix Dean Lee’s Source Code Highlight Plugin

Ron Fredericks writes: In my previous post, I discuss Dean Lee’s source code syntax highlighting plugin for WordPress. It delivers all the great features of the GeSHi open-source highlight project for Wordress bloggers.

Yet some source code displayed badly – turning a developer’s nice clean style into a chaotic and messy format. I demonstrated the display problem using a perl sendmail script I plan to discuss in a future blog post. The problem had to do with some kind of whitespace word wrap issue.

I tested various features of CSS and DIV tag attributes created by Dean’s plugin and the GeSHi php code. I am happy to say, I found a simple one-line solution. My solution is in updating Dean’s CSS container class to force white space not to wrap.

Here is my solution:
Add this property to Dean’s “ch_code_container” CSS class:

white-space: nowrap;


Here is the complete update I made to my WordPress template: wp-content/themes/eciWidget/style.css

Code (css)
  1.  
  2. /* Add the following CSS styles modified from Dean’s code Highlighter */
  3. /* Embedded Components, Inc. CSS classes update: version 1.0          */

So now let’s see how this change affects the source code highlight format using my sendmail perl script example. Compared to the image shown in my previous post, the updated highlight plugin CSS style change solved the problem. Now all lines of source code display as one line each, with the horizontal scroll bar used to see the full text:

Code (perl)
  1.  
  2. #!/usr/bin/perl
  3. ##############################################################################
  4. # FormMail                        Version 1.92                               #
  5. # Copyright 1995-2002 Matt Wright mattw@scriptarchive.com                    #
  6. # Created 06/09/95                Last Modified 04/21/02                     #
  7. # Matt’s  Script Archive, Inc.:    http://www.scriptarchive.com/             #
  8. #                                                                            #
  9. ##############################################################################
  10. # SPAM FIX                                                                   #
  11. # Embedded Components, Inc.:      http://www.embeddedcomponents.com          #
  12. # Ron Fredericks                  ronf@embeddedcomponents.com                #
  13. # Created 05/18/07                Last Modified 05/23/07                     #
  14. #                                                                            #
  15. # Logic: if number of Internet links exceed $spamChunksMax,                  #
  16. # then print a default error message instead of sending email.               #
  17. #                                                                            #
  18. # define number of links that can appear in an email                         #
  19. #
  20. # define web address to include in "too many links error message"            #
  21. "http://www.embeddedcomponents.com";                   #
  22. # define the spam error message                                              #
  23. "Sorry, no spam today please…";                             #
  24. #                                                                            #
  25. # server-side spam test (search this phrase to find all script edits)        # 
  26. #                                                                            #
  27. ##############################################################################
  28. # COPYRIGHT NOTICE                                                           #
  29. # Copyright 1995-2002 Matthew M. Wright  All Rights Reserved.                #
  30. #                                                                            #
  31. # FormMail may be used and modified free of charge by anyone so long as this #
  32. # copyright notice and the comments above remain intact.  By using this      #
  33. # code you agree to indemnify Matthew M. Wright from any liability that      #
  34. # might arise from its use.                                                  #
  35. #                                                                            #
  36. # Selling the code for this program without prior written consent is         #
  37. # expressly forbidden.  In other words, please ask first before you try and  #
  38. # make money off of my program.                                              #
  39. #                                                                            #
  40. # Obtain permission before redistributing this software over the Internet or #
  41. # in any other medium. In all cases copyright and header must remain intact. #
  42. ##############################################################################
  43. # ACCESS CONTROL FIX: Peter D. Thompson Yezek                                #
  44. #                     http://www.securityfocus.com/archive/1/62033           #
  45. ##############################################################################
  46. # Define Variables                                                           #
  47. #      Detailed Information Found In README File.                            #
  48.  
  49. # $mailprog defines the location of your sendmail program on your unix       #
  50. # system. The flags -i and -t should be passed to sendmail in order to       #
  51. # have it ignore single dots on a line and to read message for recipients    #
  52. ‘/usr/lib/sendmail -i -t’;
  53.  
  54. # @referers allows forms to be located only on servers which are defined     #
  55. # in this field.  This security fix from the last version which allowed      #
  56. # anyone on any server to use your FormMail script on their web site.        #
  57. ‘scriptarchive.com’,’embeddedcomponents.com’);
  58.  
  59. # @recipients defines the e-mail addresses or domain names that e-mail can   #
  60. # be sent to.  This must be filled in correctly to prevent SPAM and allow    #
  61. # valid addresses to receive e-mail.  Read the documentation to find out how #
  62. # this variable works!!!  It is EXTREMELY IMPORTANT.                         #
  63. # @recipients = &fill_recipients(@referers);
  64. ‘^ronf\@embeddedcomponents\.com’);
  65.  
  66. # ACCESS CONTROL FIX: Peter D. Thompson Yezek                                #
  67. # @valid_ENV allows the sysadmin to define what environment variables can    #
  68. # be reported via the env_report directive.  This was implemented to fix     #
  69. # the problem reported at http://www.securityfocus.com/bid/1187              #
  70.  
  71. @valid_ENV = (‘REMOTE_HOST’,‘REMOTE_ADDR’,‘REMOTE_USER’,‘HTTP_USER_AGENT’);
  72. #@valid_ENV = (‘REMOTE_HOST’,’REMOTE_ADDR’,’REMOTE_USER’,’HTTP_USER_AGENT’,’HTTP_REFERER’);
  73.  
  74. # Done                                                                       #
  75. ##############################################################################
  76.  
  77. # Check Referring URL
  78. # Retrieve Date
  79. # Parse Form Contents
  80. # Check Required Fields
  81. # Send E-Mail
  82. # Return HTML Page or Redirect User
  83. # NOTE rev1.91: This function is no longer intended to stop abuse, that      #
  84. #    functionality is now embedded in the checks made on @recipients and the #
  85. #    recipient form field.                                                   #
  86. # Localize the check_referer flag which determines if user is valid.     #
  87. # If a referring URL was specified, for each valid referer, make sure    #
  88.     # that a valid referring URL was passed to FormMail.                     #
  89. ‘HTTP_REFERER’‘HTTP_REFERER’# If the HTTP_REFERER was invalid, send back an error.                   #
  90. ‘bad_referer’# Define arrays for the day of the week and month of the year.           #
  91. ‘Sunday’,‘Monday’,‘Tuesday’,‘Wednesday’,
  92.                ‘Thursday’,‘Friday’,‘Saturday’‘January’,‘February’,‘March’,‘April’,‘May’,‘June’,‘July’,
  93.                ‘August’,‘September’,‘October’,‘November’,‘December’);
  94.  
  95.     # Get the current time and format the hour, minutes and seconds.  Add    #
  96.     # 1900 to the year to get the full 4 digit year.                         #
  97. "%02d:%02d:%02d"# Format the date.                                                       #
  98.     $date = "$days[$wday], $months[$mon] $mday, $year at $time"# part of server-side spam test
  99.     # initialize our antispam counter
  100. # Define the configuration associative array.                            #
  101.     %Config = (‘recipient’,,          ‘subject’,,
  102.                ’email’,,              ‘realname’,,
  103.                ‘redirect’,,           ‘bgcolor’,,
  104.                ‘background’,,         ‘link_color’,,
  105.                ‘vlink_color’,,        ‘text_color’,,
  106.                ‘alink_color’,,        ‘title’,,
  107.                ‘sort’,,               ‘print_config’,,
  108.                ‘required’,,           ‘env_report’,,
  109.                ‘return_link_title’,‘return_link_url’,,
  110.                ‘print_blank_fields’,, ‘missing_fields_redirect’,);
  111.  
  112.     # Determine the form’s REQUEST_METHOD (GET or POST) and split the form   #
  113.     # fields up into their name-value pairs.  If the REQUEST_METHOD was      #
  114.     # not GET or POST, send an error.                                        #
  115. ‘REQUEST_METHOD’‘GET’) {
  116.         # Split the name-value pairs
  117. ‘QUERY_STRING’‘REQUEST_METHOD’‘POST’) {
  118.         # Get the input
  119. ‘CONTENT_LENGTH’});
  120.  
  121.         # Split the name-value pairs
  122. ‘request_method’);
  123.     }
  124.  
  125.     # For each name-value pair:                                              #
  126. # Split the pair up into individual variables.                       #
  127. # Decode the form encoding on the name and value variables.          #
  128.         # v1.92: remove null bytes                                           #
  129. "C""C"# part of server-side spam test
  130.         # count number of accesses to internet this email message might have…
  131. "href=""http:""https:""ftp:""mailto:");
  132.  
  133.         # If the field name has been specified in the %Config array, it will #
  134.         # return a 1 for defined($Config{$name}}) and we should associate    #
  135.         # this value with the appropriate configuration variable.  If this   #
  136.         # is not a configuration form field, put it into the associative     #
  137.         # array %Form, appending the value with a ‘, ‘ if there is already a #
  138.         # value present.  We also save the order of the form fields in the   #
  139.         # @Field_Order array so we can use this order for the generic sort.  #
  140. "$Form{$name}, $value"# The next six lines remove any extra spaces or new lines from the       #
  141.     # configuration variables, which may have been caused if your editor     #
  142.     # wraps lines after a certain length or if you used spaces between field #
  143.     # names or environment variables.                                        #
  144.     $Config{‘required’‘required’‘env_report’‘env_report’‘print_config’‘print_config’} =~ s/(\s+)?\n+(\s+)?//g;
  145.  
  146.     # Split the configuration variables into individual field names.         #
  147. ‘required’‘env_report’‘print_config’});
  148.  
  149.     # ACCESS CONTROL FIX: Only allow ENV variables in @valid_ENV in          #
  150.     # @Env_Report for security reasons.                                      #
  151. # Localize the variables used in this subroutine.                        #
  152. # The following insures that there were no newlines in any fields which  #
  153.     # will be used in the header.                                            #
  154. ‘subject’’email’‘realname’‘recipient’‘invalid_headers’‘recipient’‘bad_referer’‘no_recipient’# This block of code requires that the recipient address end with    #
  155.         # a valid domain or e-mail address as defined in @recipients.        #
  156. ‘recipient’#send_to < 0) { &error(‘no_recipient’) }
  157.         $Config{‘recipient’‘,’# For each require field defined in the form:                            #
  158. # If the required field is the email field, the syntax of the email  #
  159.         # address if checked to make sure it passes a valid syntax.          #
  160. ’email’# Otherwise, if the required field is a configuration field and it   #
  161.         # has no value or has been filled in with a space, send an error.    #
  162. # If it is a regular form field which has not been filled in or      #
  163.         # filled in with a space, flag it as an error field.                 #
  164. # If any error fields have been found, send error message to the user.   #
  165. ‘missing_fields’# Local variables used in this subroutine initialized.                   #
  166. # Now that we have finished using form values for any e-mail related     #
  167.     # reasons, we will convert all of the form fields and config values      #
  168.     # to remove any cross-site scripting security holes.                     #
  169. # If redirect option is used, print the redirectional location header.   #
  170. ‘redirect’"Location: $safeConfig{‘redirect’}\n\n";
  171.     }
  172.  
  173.     # Otherwise, begin printing the response page.                           #
  174. # Print HTTP header and opening HTML tags.                           #
  175. "Content-type: text/html\n\n""<html>\n <head>\n";
  176.  
  177.         # Print out title of page                                            #
  178. ‘title’"<title>$safeConfig{‘title’}</title>\n""<title>Thank You</title>\n"" </head>\n <body";
  179.  
  180.         # Get Body Tag Attributes                                            #
  181. # Close Body Tag                                                     #
  182. ">\n  <center>\n";
  183.  
  184.         # Print custom or generic title.                                     #
  185. ‘title’"<h1>$safeConfig{‘title’}</h1>\n""<h1>Thank You For Filling Out This Form</h1>\n""</center>\n""Below is what you submitted to $safeConfig{‘recipient’} on ""$date<p><hr size=1 width=75\%><p>\n";
  186.  
  187.         # If a sort order is specified, sort the form fields based on that.  #
  188. ‘sort’# Set the temporary $sort_order variable to the sorting order,   #
  189.             # remove extraneous line breaks and spaces, remove the order:    #
  190.             # directive and split the sort fields into an array.             #
  191. ‘sort’# For each sorted field, if it has a value or the print blank    #
  192.             # fields option is turned on print the form field and value.     #
  193. ‘print_blank_fields’"<b>$sfname:</b> $Form{$sorted_field}<p>\n";
  194.                 }
  195.             }
  196.         }
  197.  
  198.         # Otherwise, use the order the fields were sent, or alphabetic.      #
  199. # Sort alphabetically if requested.
  200. ‘sort’‘alphabetic’# For each form field, if it has a value or the print blank      #
  201.             # fields option is turned on print the form field and value.     #
  202. ‘print_blank_fields’"<b>$fname:</b> $Form{$field}<p>\n""<p><hr size=1 width=75%><p>\n";
  203.  
  204.         # Check for a Return Link and print one if found.                    #
  205. ‘return_link_url’‘return_link_title’"<ul>\n""<li><a href=\"$safeConfig{‘return_link_url’}\">$safeConfig{‘return_link_title’}</a>\n""</ul>\n";
  206.         }
  207.  
  208.         # Print the page footer.                                             #
  209. "(END HTML FOOTER)""http://www.scriptarchive.com/formmail.html""http://www.scriptarchive.com/"‘s  Script Archive, Inc.</a></font></center>
  210.         </body>
  211.        </html>
  212. (END HTML FOOTER)
  213.     }
  214. }
  215.  
  216. sub send_mail {
  217.     # Localize variables used in this subroutine.                            #
  218.     local($print_config,$key,$sort_order,$sorted_field,$env_report);
  219.  
  220.     # part of server-side spam test
  221.     # Decide if we should skip sending this email because it could be spam
  222.     if ( $spamChunkCount > $spamChunksMax ) {
  223.         print "
  224. <!DOCTYPE HTML PUBLIC ‘‘>
  225. <html>
  226. <head>
  227. <title>Error: Request Method</title>
  228. </head>
  229. <body bgcolor=#FFFFFF text=#000000>
  230. <p>$spamMessage</p>
  231. <p><form>
  232. <input type=\"Button\" value=\"Go back and try again\" onclick=\"history.back()\">
  233. </form></p>
  234. <p><a href=\"$spamChunkErrorLink\">$spamChunkErrorLink</a></p>
  235. </body>
  236. </html>";     
  237.         exit;
  238.     }
  239.  
  240.  
  241.     # Open The Mail Program
  242.     open(MAIL,"|$mailprog");
  243.  
  244.     print MAIL "To: $Config{‘recipient‘}\n";
  245.     print MAIL "From: $Config{‘‘} ($Config{‘‘})\n";
  246.  
  247.     # Check for Message Subject
  248.     if ($Config{‘‘}) { print MAIL "Subject: $Config{‘‘}\n\n" }
  249.     else                    { print MAIL "Subject: WWW Form Submission\n\n" }
  250.  
  251.     print MAIL "Below is the result of your feedback form.  It was submitted by\n";
  252.     print MAIL "$Config{‘‘} ($Config{‘‘}) on $date\n";
  253.     print MAIL "-" x 75 . "\n\n";
  254.        
  255.     # part of server-side spam test
  256.     # uncomment this next line to view details of antispam logic in action
  257.     # print MAIL "ANTISPAM_URLCOUNT = " .  $spamChunkCount. " diff= ". ($spamChunkCount-$spamChunksMax). "\n\n";
  258.        
  259.  
  260.     if (@Print_Config) {
  261.         foreach $print_config (@Print_Config) {
  262.             if ($Config{$print_config}) {
  263.                 print MAIL "$print_config: $Config{$print_config}\n\n";
  264.             }
  265.         }
  266.     }
  267.  
  268.     # If a sort order is specified, sort the form fields based on that.      #
  269.     if ($Config{‘‘} =~ /^order:.*,.*/) {
  270.  
  271.         # Remove extraneous line breaks and spaces, remove the order:        #
  272.         # directive and split the sort fields into an array.                 #
  273.         local $sort_order = $Config{‘‘};
  274.         $sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
  275.         $sort_order =~ s/(\s+)?\n+(\s+)?//g;
  276.         $sort_order =~ s/order://;
  277.         @sorted_fields = split(/,/, $sort_order);
  278.  
  279.         # For each sorted field, if it has a value or the print blank        #
  280.         # fields option is turned on print the form field and value.         #
  281.         foreach $sorted_field (@sorted_fields) {
  282.             if ($Config{‘‘} || $Form{$sorted_field} ne ‘‘) {
  283.                 print MAIL "$sorted_field: $Form{$sorted_field}\n\n";
  284.             }
  285.         }
  286.     }
  287.  
  288.     # Otherwise, print fields in order they were sent or alphabetically.     #
  289.     else {
  290.  
  291.         # Sort alphabetically if specified:                                  #
  292.         if ($Config{‘‘} eq ‘alphabetic‘) {
  293.             @Field_Order = sort @Field_Order;
  294.         }
  295.  
  296.         # For each form field, if it has a value or the print blank          #
  297.         # fields option is turned on print the form field and value.         #
  298.         foreach $field (@Field_Order) {
  299.             if ($Config{‘‘} || $Form{$field} ne ‘‘) {
  300.                 print MAIL "$field: $Form{$field}\n\n";
  301.             }
  302.         }
  303.     }
  304.  
  305.     print MAIL "-" x 75 . "\n\n";
  306.  
  307.     # Send any specified Environment Variables to recipient.                 #
  308.     foreach $env_report (@Env_Report) {
  309.         if ($ENV{$env_report}) {
  310.             print MAIL "$env_report: $ENV{$env_report}\n";
  311.         }
  312.     }
  313.  
  314.     close (MAIL);
  315. }
  316.  
  317. sub check_email {
  318.     # Initialize local email variable with input to subroutine.              #
  319.     $email = $_[0];
  320.  
  321.     # If the e-mail address contains:                                        #
  322.     if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ ||
  323.  
  324.         # the e-mail address contains an invalid syntax.  Or, if the         #
  325.         # syntax does not match the following regular expression pattern     #
  326.         # it fails basic syntax verification.                                #
  327.  
  328.         $email !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/) {
  329.  
  330.         # Basic syntax requires:  one or more characters before the @ sign,  #
  331.         # followed by an optional ‘[‘, then any number of letters, numbers,  #
  332.         # dashes or periods (valid domain/IP characters) ending in a period  #
  333.         # and then 2 or 3 letters (for domain suffixes) or 1 to 3 numbers    #
  334.         # (for IP addresses).  An ending bracket is also allowed as it is    #
  335.         # valid syntax to have an email address like: user@[255.255.255.0]   #
  336.  
  337.         # Return a false value, since the e-mail address did not pass valid  #
  338.         # syntax.                                                            #
  339.         return 0;
  340.     }
  341.  
  342.     else {
  343.  
  344.         # Return a true value, e-mail verification passed.                   #
  345.         return 1;
  346.     }
  347. }
  348.  
  349. # This was added into v1.91 to further secure the recipients array.  Now, by #
  350. # default it will assume that valid recipients include only users with       #
  351. # usernames A-Z, a-z, 0-9, _ and – that match your domain exactly.  If this  #
  352. # is not what you want, you should read more detailed instructions regarding #
  353. # the configuration of the @recipients variable in the documentation.        #
  354. sub fill_recipients {
  355.     local(@domains) = @_;
  356.     local($domain,@return_recips);
  357.  
  358.     foreach $domain (@domains) {
  359.         if ($domain =~ /^\d+\.\d+\.\d+\.\d+$/) {
  360.             $domain =~ s/\./\\\./g;
  361.             push(@return_recips,’^[\w\-\.]+\@\[‘ . $domain . ‘\]‘);
  362.         }
  363.         else {
  364.             $domain =~ s/\./\\\./g;
  365.             $domain =~ s/\-/\\\-/g;
  366.             push(@return_recips,’^[\w\-\.]+\@‘ . $domain);
  367.         }
  368.     }
  369.  
  370.     return @return_recips;
  371. }
  372.  
  373. # This function will convert <, >, & and " to their HTML equivalents.        #
  374. sub clean_html {
  375.     local $value = $_[0];
  376.     $value =~ s/\&/\&/g;
  377.     $value =~ s/</\</g;
  378.     $value =~ s/>/\>/g;
  379.     $value =~ s/"/\"/g;
  380.     return $value;
  381. }
  382.  
  383.  
  384. # This function returns the number of text chucks in a string
  385. sub count_chunks {
  386.     # Usage: &count_chunks("string","substring")
  387.     # Returns: the number of substring chunks found in a string
  388.     # part of server-side spam test
  389.     # reference: http://www.blazonry.com/perl/linkcount_pl.txt
  390.     my $myString;
  391.     my $myChunk;
  392.     my $myInd;
  393.     my $myInd2;
  394.     my $myCount;
  395.     $myString = $_[0];
  396.     $myChunk = $_[1];
  397.    
  398.     #convert text to lowercase
  399.     $myString =~ tr/[A-Z]/[a-z]/;     
  400.     $myInd = 0;   $myInd2 = 0; $myCount = 0;
  401.     while ($myInd >= 0) {       
  402.         # get index place of href=
  403.         $myInd = index($myString, $myChunk, $myInd2);           
  404.         if ($myInd  >= 0) {
  405.             $myInd2 = $myInd + 1;
  406.             $myCount = $myCount + 1;
  407.         }
  408.     }
  409.     return $myCount;
  410. }
  411.  
  412. sub body_attributes {
  413.     # Check for Background Color
  414.     if ($Config{‘‘}) { print " bgcolor=\"$safeConfig{‘‘}\"" }
  415.  
  416.     # Check for Background Image
  417.     if ($Config{‘background‘}) { print " background=\"$safeConfig{‘background‘}\"" }
  418.  
  419.     # Check for Link Color
  420.     if ($Config{‘‘}) { print " link=\"$safeConfig{‘‘}\"" }
  421.  
  422.     # Check for Visited Link Color
  423.     if ($Config{‘‘}) { print " vlink=\"$safeConfig{‘‘}\"" }
  424.  
  425.     # Check for Active Link Color
  426.     if ($Config{‘‘}) { print " alink=\"$safeConfig{‘‘}\"" }
  427.  
  428.     # Check for Body Text Color
  429.     if ($Config{‘‘}) { print " text=\"$safeConfig{‘‘}\"" }
  430. }
  431.  
  432. sub error {
  433.     # Localize variables and assign subroutine input.                        #
  434.     local($error,@error_fields) = @_;
  435.     local($host,$missing_field,$missing_field_list);
  436.  
  437.     if ($error eq ‘‘) {
  438.         if ($ENV{‘‘} =~ m|^https?://([\w\.]+)|i) {
  439.             $host = $1;
  440.             my $referer = &clean_html($ENV{‘‘});
  441.             print <<"(END ERROR HTML)";
  442. Content-type: text/html
  443.  
  444. <html>
  445. <head>
  446.   <title>Bad Referrer – Access Denied</title>
  447. </head>
  448. <body bgcolor=#FFFFFF text=#000000>
  449.   <center>
  450.    <table border=0 width=600 bgcolor=#9C9C9C>
  451.     <tr><th><font size=+2>Bad Referrer – Access Denied</font></th></tr>
  452.    </table>
  453.    <table border=0 width=600 bgcolor=#CFCFCF>
  454.     <tr><td>The form attempting to use
  455.      <a href="http://www.scriptarchive.com/formmail.html">FormMail</a>
  456.      resides at <tt>$referer</tt>, which is not allowed to access
  457.      this cgi script.<p>
  458.  
  459.      If you are attempting to configure FormMail to run with this form, you need
  460.      to add the following to \@referers, explained in detail in the
  461.      <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<p>
  462.  
  463.      Add <tt>’‘</tt> to your <tt><b>\@referers</b></tt> array.<hr size=1>
  464.      <center><font size=-1>
  465.       <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 – 2002  Matt Wright
  466.       A Free Product of <a href="http://www.scriptarchive.com/">Matt’"(END ERROR HTML)"#FFFFFF text=#000000>
  467. #9C9C9C>
  468. #CFCFCF>
  469. "http://www.scriptarchive.com/"‘s  Script Archive,
  470.         Inc.</a></font></tt></th></tr>
  471.    </table>
  472.   </center>
  473. </body>
  474. </html>
  475. (END ERROR HTML)
  476.         }
  477.     }
  478.  
  479.     elsif ($error eq ‘‘) {
  480.             print <<"(END ERROR HTML)";
  481. Content-type: text/html
  482.  
  483. <html>
  484. <head>
  485.   <title>Error: Request Method</title>
  486. </head>
  487. <body bgcolor=#FFFFFF text=#000000>
  488.   <center>
  489.    <table border=0 width=600 bgcolor=#9C9C9C>
  490.     <tr><th><font size=+2>Error: Request Method</font></th></tr>
  491.    </table>
  492.    <table border=0 width=600 bgcolor=#CFCFCF>
  493.     <tr><td>The Request Method of the Form you submitted did not match
  494.      either <tt>GET</tt> or <tt>POST</tt>.  Please check the form and make sure the
  495.      <tt>method=</tt> statement is in upper case and matches <tt>GET</tt> or <tt>POST</tt>.<p>
  496.  
  497.      <center><font size=-1>
  498.       <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 – 2002  Matt Wright
  499.       A Free Product of <a href="http://www.scriptarchive.com/">Matt’‘no_recipient’"(END ERROR HTML)"#FFFFFF text=#000000>
  500. #9C9C9C>
  501. #CFCFCF>
  502. "http://www.scriptarchive.com/readme/formmail.html""http://www.scriptarchive.com/formmail.html""http://www.scriptarchive.com/"‘s  Script Archive, Inc.</a>
  503.      </font></center>
  504.     </td></tr>
  505.    </table>
  506.   </center>
  507. </body>
  508. </html>
  509. (END ERROR HTML)
  510.     }
  511.  
  512.     elsif ($error eq ‘‘) {
  513.             print <<"(END ERROR HTML)";
  514. Content-type: text/html
  515.  
  516. <html>
  517. <head>
  518.   <title>Error: Bad Header Fields</title>
  519. </head>
  520. <body bgcolor=#FFFFFF text=#000000>
  521.   <center>
  522.    <table border=0 width=600 bgcolor=#9C9C9C>
  523.     <tr><th><font size=+2>Error: Bad Header Fields</font></th></tr>
  524.    </table>
  525.    <table border=0 width=600 bgcolor=#CFCFCF>
  526.     <tr><td>The header fields, which include <tt>recipient</tt>, <tt>email</tt>, <tt>realname</tt> and <tt>subject</tt> were
  527.      filled in with invalid values. You may not include any newline characters in these parameters.
  528.      More information on filling in these form fields and variables can be
  529.      found in the <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<hr size=1>
  530.  
  531.      <center><font size=-1>
  532.       <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 – 2002  Matt Wright
  533.       A Free Product of <a href="http://www.scriptarchive.com/">Matt’‘missing_fields’‘missing_fields_redirect’"Location: "‘missing_fields_redirect’}) . "\n\n""<li>""\n""(END ERROR HTML)"#9C9C9C>
  534. #CFCFCF>
  535. ‘s back button to return to the form and try again.<hr size=1>
  536.      <center><font size=-1>
  537.       <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.92 &copy; 1995 – 2002  Matt Wright
  538.       A Free Product of <a href="http://www.scriptarchive.com/">Matt’

Technorati Tags: , , , , , , ,

5 Responses to “How to Fix Dean Lee’s Source Code Highlight Plugin”

  1. Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components Says:

    […] New CSS classes for WordPress template style.css file Version 1.0 from Embedded Components http://www.embeddedcomponents.com/2007/05/how-to-fix-dean-lees-source-code-highlight-plugin/#sample […]

  2. hiutopor Says:

    Hi

    Very interesting information! Thanks!

    Bye

  3. Joel Cochran Says:

    I accomplished the same thing, but by a slightly different route.

    First, the wrap/nowrap issue is a configuration option in WordPress, so I just unchecked the wrap option.

    Second, in geshi.css, I just added “overflow:auto;” to the dean_ch style section. I originally had “overflow:scroll;”, but that made the scroll bars appear constantly, even when not needed. I saw “overflow: auto;” in your example above, and I like it much better. Thanks!

  4. Ron Fredericks Says:

    Thanks Joel for the update.

  5. Cercernvesrow Says:

    Hello
    nice site

Leave a Reply