Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

The problem is that this isn't something you can realy opt-out of. For instance if you post code, the server should realy do the HTML markup for highlighting then (no reason to do it over and over). If the next person doesn't want highlighting then they don't use the CSS to highlight it. However even though that person didn't want the highlighting the server still went to the work to implement the code highlighting HTML.

As I type this I had an idea though. Why doesn't PerlMonks cache a node after formating all the links and formating? As far as I could tell now it reapplies links and formating everytime the node is displayed. Why not add a feild that is identical to the content but holds the already html formated output? When edits are done it presents the original post, and when submited saves the unformated AND formated copies? This could be a huge bonus even if it saves only microseconds per post. Just thinking out loud so try not to shoot me. Anyway I'm all for CSS based syntax highlighting if it can be in a way that doesn't add huge additional load.

Eric Hodges

In reply to Re^3: Code highlighting? by eric256
in thread Code highlighting? by radiantmatrix

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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2023-12-06 11:30 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (30 votes). Check out past polls.