Create code block without syntax highlighting or line numbers

Sorry for hijacking this old thread. The quoted example is nearly what I was looking for. Only problem I have is that this snipped generates line numbers which I want to get rid off.

I’ve tried using nohighlight=false as this turns of line numbers but without luck also wrapping my code in triple backticks won’t work as it also generates line numbers. Is there a way to turn the numbering off for selected passages?

I know I could change my config.toml from

    lineNos = true


    lineNos = false

But mostly I want the numbering to be present.

Only using go {linenos=false} works (regarding no line numbers) but then I get syntax highlighting which isn’t what I need in this place.

Then don’t do it anymore.

Presuming your site/theme is not using a third-party syntax highlighter, this markdown will produce a code block without syntax highlighting or line numbers:

some code
some more code

Hi @jmooring,

thank you for answering.

Your example doesn’t work. Using your code results in a numbered code block, see here

The source files of my website you can find in this repo if needed.

You have guessSyntax = true in your site configuration.

1 Like

OK, switched to false and now, you already know it, it’s working as expected. Thank you for your help, much appreciated!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.