-
$arr=[
'foo' => 'foo',
'bar' => 'bar',
'baz' => 'baz',
];
$code=json_encode($arr);
{!! Shiki::highlight(code: $code, language: 'json', theme: 'github-light',) !!} what I expect: {
"foo": "foo",
"bar": "bar",
"baz": "baz"
} what I get: {"foo":"foo","bar":"bar","baz":"baz"} |
Beta Was this translation helpful? Give feedback.
Answered by
riasvdv
Dec 7, 2021
Replies: 1 comment
-
Shiki highlights code, it does not format it. You should be able to do this by calling |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lordisp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shiki highlights code, it does not format it. You should be able to do this by calling
json_encode($arr, JSON_PRETTY_PRINT);
instead