开发者

GeSHi single like link

开发者 https://www.devze.com 2023-01-02 04:16 出处:网络
Is it possible to instruct GeSHi (http://qbnz.co开发者_StackOverflowm/highlighter/) to generate link to single line. For example if I show highlighted code on \'example.com/my-code\' URL, I would like

Is it possible to instruct GeSHi (http://qbnz.co开发者_StackOverflowm/highlighter/) to generate link to single line. For example if I show highlighted code on 'example.com/my-code' URL, I would like to be able to have link like: 'example.com/my-mode#line-69' or something like that...


Check the docs: http://qbnz.com/highlighter/geshi-doc.html#adding-ids-to-each-line

So you have to do

$geshi->enable_ids(true);

And then all the lines will have ids which you can link to.

0

精彩评论

暂无评论...
验证码 换一张
取 消