Php code highlighting in Jekyll kramdown not working
I am using Jekyll with kramdown and pygments, it works fine for javascript or python code, but when I create php like:
{% highlight php %}
header('Content-Type: application/json');
echo json_encode(array(
'jsonrpc' => "2.0",
'result' => $result,
'id' => $request->id,
'error' => null
));
{% endhighlight %}
Each line represents one range with a class x
:
<code class="language-php" data-lang="php"><span class="x">header('Content-Type: application/json');</span>
<span class="x">echo json_encode(array(</span>
<span class="x"> 'jsonrpc' => "2.0",</span>
<span class="x"> 'result' => $result,</span>
<span class="x"> 'id' => $request->id,</span>
<span class="x"> 'error' => null</span>
<span class="x">));</span></code>
Why don't I have tokens with different classes for php code?
+3
source to share
2 answers
As of 8 Aug 2016 From https://github.com/jekyll/jekyll/issues/1633#issuecomment-238383509
We no longer support Pyigs. We are using Rouge.
The new syntax looks like this:
```php?start_inline=true header('Content-Type: application/json'); echo json_encode(array( 'jsonrpc' => "2.0", 'result' => $result, 'id' => $request->id, 'error' => null )); ```
+2
source to share