我正在使用Jekyll与kramdown和pygments,它适用于javascript或python代码,但当我创建PHP像:
{% highlight php %} header('Content-Type: application/json'); echo json_encode(array( 'jsonrpc' => "2.0", 'result' => $result, 'id' => $request->id, 'error' => null )); {% endhighlight %}
每行是一个带有x
类的跨度:
header('Content-Type: application/json');
echo json_encode(array(
'jsonrpc' => "2.0",
'result' => $result,
'id' => $request->id,
'error' => null
));
为什么我的PHP代码没有不同类的令牌?
如果你想忘记代码块开头的php开始标记,你必须将Pygments startinline参数设置为true.
{% highlight php startinline=true %}
请参阅Pygments文档