That selector actually matches up with a bit of Javascript just above it:
$('p.code').each(function (i, c) {
var code = $(c).find('tt.codetext').text().replace(/\u00a0/g,' ').
+replace(/\s+$/,'');
var dl = $(c).find('span.embed-code-dl');
var pre = $(
'<pre class="blockcode"><code>'
+ $('<div/>').text(code).html()
+ '</code></pre>'
);
var footer = $('<div style="text-align:right"><small></small></div
+>');
if (dl.html()) footer.find('small').append(dl.html());
$(c).after(footer);
$(c).replaceWith(pre);
});
The intention of that is to rewrite PerlMonks' code-block markup into a much simpler <pre class="blockcode"><code>...</code></pre>, which the syntax highlighter can then deal with.
However PerlMonks' code-block markup does vary depending on your display settings for code listings. My settings are:
Code Wrapping Off [ ]
Code Wrap Length [ ]
Auto Code Wrapping [ Yes ]
Code Prefix [ ]
Large Code Font [ ]
Don't show embedded d/l links [ ]
Show download link on code N lines long or more: [ 4 ]
If you let me know your settings I can try to make sure pm2.js works better with them.
-
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.
|