发点代码
var s = "JavaScript syntax highlighting";
alert(s);
s = "Python syntax highlighting"
print s
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
<?php
echo 111;
#!/bin/bash
#
if [ ! -e ./config.ini ]; then
echo "config.ini is not exists..please check.."
exit 1
fi
function () { return "This code is highlighted as Javascript!"}
foo@bar:~$ whoami
foo
cd \
copy a b
ping 192.168.0.1
这个高亮很牛啊,怎么做的呀?
找个相应的库 markdown hightlight 的就行