Disable Code Block Gutter with Markdown

  • Unknown's avatar

    I’m starting to use Markdown as a primary way of editing blog posts and I want to be able to turn off the “gutter” (auto-line-numbers) for most of my code blocks. The example provided at https://en.support.wordpress.com/markdown-quick-reference/ allows for choosing a syntax highlighting code language, but doesn’t have an option for turning off the gutter or other parameters listed at https://en.support.wordpress.com/code/posting-source-code/

    I’ve tried using the official Markdown Extra curly bracket “attribute block” described at https://michelf.ca/projects/php-markdown/extra/#spe-attr but it did not work for me. Is anyone able to set the gutter=false option for their Markdown code blocks on a WordPress.com blog?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    I have another issue that might be solved if I can figure out how to specify code block attributes with Markdown. When I post code that appears to have a URL in it such as http://YourHost.YourDomain.Com/ then WordPress automatically turns it into an active link. This is a problem for me because when I’m posting code I’m usually using fake “example” URL’s” and I don’t want them to be clickable.

    According to the WP Support Article Posting Source Code, I should be able to use autolinks=false to disable links in the code snippet. Unfortunately I can’t figure out how to set any options on a code span or block in WordPress Markdown.

    Please reply if you have a way to do this. Thanks!

  • Unknown's avatar

    The theme I’m currently using is Twenty Ten which appears to still be the most popular WordPress.com theme as of March 18, 2015.

    Could the Markdown source code auto-formatting appear differently depending on which WordPress.com theme is in use? I would hope the basic syntax highlighting, auto-links, etc would be the same – and each theme would change only basic fonts, sizes, and colors.

    If the Markdown code support is better on a specific theme, please let me know which one so I can try it out. Thanks :-).

  • The topic ‘Disable Code Block Gutter with Markdown’ is closed to new replies.