是否有可用的javascript插件可以为示例代码着色,使其看起来像在文本编辑器中一样?以php.net prinf页面为例,我想将其转换为:
<code>
<?php<br>
$num = 5;<br>
$location = 'tree';<br>
$format = 'There are %d monkeys in the %s';<br>
printf($format, $num, $location);<br>
?>
</code>
对此
<code>
<span style="color: #000000">
<span style="color: #0000BB"><?php<br>$num </span>
<span style="color: #007700">= </span>
<span style="color: #0000BB">5</span>
<span style="color: #007700">;<br></span>
<span style="color: #0000BB">$location </span>
<span style="color: #007700">= </span>
<span style="color: #DD0000">'tree'</span>
<span style="color: #007700">;<br><br></span>
<span style="color: #0000BB">$format </span>
<span style="color: #007700">= </span>
<span style="color: #DD0000">'There are %d monkeys in the %s'</span>
<span style="color: #007700">;<br></span>
<span style="color: #0000BB">printf</span>
<span style="color: #007700">(</span>
<span style="color: #0000BB">$format</span>
<span style="color: #007700">, </span>
<span style="color: #0000BB">$num</span>
<span style="color: #007700">, </span>
<span style="color: #0000BB">$location</span>
<span style="color: #007700">);<br></span>
<span style="color: #0000BB">?></span>
</span>
最佳答案