Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

line numbers in code block

jackmaessenjackmaessen ✭✭✭
edited December 2013 in Vanilla 2.0 - 2.8

hello,
I am using vanilla 2 and i enabled GeSHi for syntaxhighlighting. It all works fine but i do not see the linenumbers in the message when posted. It is enabled in GeSHi. I also tried google prettifier for syntaxing and the same problem: only highlighting but no line numbers.
How can i set the line numbers when users put a code block?

Comments

  • hgtonighthgtonight MVP
    edited December 2013

    Welcome to the community!

    It looks like GeSHi (and the plugin in this repo) supports line numbers out of the box. You need to add a line attribute to your 'pre' elements. Something like this:

    < pre line="1">
      // This is my code
    </pre>
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • jackmaessenjackmaessen ✭✭✭
    edited December 2013

    Perfect! this does the job. I now use per example lang="php" and line="1" between the pre tags and it gives me a perfect block of code with the right higlighting and linenumbers for the specific language. Thank you very much

Sign In or Register to comment.