syntaxhighlighter 与n2br冲突改进

2007-09-06 02:23 星期四
shCore.js 134行

增加:

str=str.replace(/& l t ; BR>;/igm,"& n b s p ;"); //itjoy.net

syntaxhighlighter 使用

2007-09-05 03:30 星期三
Configuration options for code blocks.
These options allow you to individually configure text blocks.
格式:
< pre name="code" class="html:nocontrols:firstline[10]">
... some code here ...
< /pre>
(使用中请删除< pre 和 < /pre 中的空格 )

参数说明:
nogutter :Will display no gutter.
nocontrols :Will display no controls at the top.
collapse :Will collapse the block by default.
firstline[value] :Will begin line count at value. Default value is 1.
showcolumns :Will show row columns in the first line.


The options are passed together with the alias and are separated by a colon : character.


... some code here ...




例如
< pre name="code" class="php">
switch($serendipity['calendar']) {
default: case 'gregorian': // How many days does the month have?
$ts = strtotime($year . '-' . sprintf('%02d', $month) . '-01');
$now = serendipity_serverOffsetHour(time());
$nrOfDays = date('t', $ts);
$firstDayWeekDay = date('w', $ts);
}

< /pre>
(使用中请删除< pre 和 < /pre 中的空格 )
效果如下:


switch($serendipity['calendar']) {
default: case 'gregorian': // How many days does the month have?
$ts = strtotime($year . '-' . sprintf('%02d', $month) . '-01');
$now = serendipity_serverOffsetHour(time());
$nrOfDays = date('t', $ts);
$firstDayWeekDay = date('w', $ts);
}




Supported languages
Here's a list of supported languages and their aliases:

Language Aliases
C++ cpp, c, c++
C# c#, c-sharp, csharp
CSS css
Delphi delphi, pascal
Java java
Java Script js, jscript, javascript
PHP php
Python py, python
Ruby rb, ruby, rails, ror
Sql sql
VB vb, vb.net
XML/HTML xml, html, xhtml, xslt