Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
This is from Vim. I just went:

:ru! syntax/2html.vim

Note that it doesn't handle [] constructs; it could easily be made to do so by adding to the 2html.vim file. I've also used perltidy to make HTML; it too would have to be post-filtered.

package XX;

sub _create_accessors
{
    my %orderObjectFields = @_;

    foreach my $field ( keys %orderObjectFields )
    {
        my $default = $orderObjectFields{$field};
        no strict 'refs';
        *{ __PACKAGE__ . "::$field" } = sub
        {
            my $value =
              ( scalar @_ > 1 ? $_<span style="background-color: #f2f2f2"><font color="#ff00ff">0</font></span>->{$field} = $_<span style="background-color: #f2f2f2"><font color="#ff00ff">1</font></span> : $_<span style="background-color: #f2f2f2"><font color="#ff00ff">0</font></span>->{$field} );
            $value = $default unless defined $value;
            $value;
        };
    }
}


In reply to Re: Code Highlighting in the code tag by bikeNomad
in thread Code Highlighting in the code tag by mischief

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 meditating upon the Monastery: (4)
As of 2024-04-19 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found