Lets see how this works
Let's look at a few lines from my terminal as an example.
Here is what they look like if I simply indent the block of text without any code fence or anything.
~/Sites/d7sandbox1/sites/all/themes $ rm -R mybrokentheme
~/Sites/d7sandbox1/sites/all/themes $ drush vset -y theme_default bartik
Sweet. No syntax coloring. This is how it should be.
Now lets format these same lines as a fenced code block, but without specifying the language.
~/Sites/d7sandbox1/sites/all/themes $ rm -R mybrokentheme
~/Sites/d7sandbox1/sites/all/themes $ drush vset -y theme_default bartik
Excellent. Still no syntax coloring because I didn't ask for any. This is how it should be.
And finally, here is a fenced code block with the language specified.
<div class="example">
<p>This is an example of some HTML code in a fenced code block.</p>
</div>
Perfect. The code is syntax highlighted properly because it was explicitly specified in the markdown.
I wish it were possible to configure Marked to
- never apply automatic syntax highlighting to traditional Markdown indented style code blocks.
- not attempt to automatically infer the syntax for fenced code blocks without a specified language.
- always apply syntax highlighting to fenced code blocks if a language is explicitly specified after the backticks.
1 and 3 should be non-negotiable. But 2 could be a preference.
Here are the current Marked preferences:
~/Sites/d7sandbox1/sites/all/themes $ rm -R mybrokentheme
~/Sites/d7sandbox1/sites/all/themes $ drush vset -y theme_default bartik
Here's the same fenced code block with an extra line before and after:
~/Sites/d7sandbox1/sites/all/themes $ rm -R mybrokentheme
~/Sites/d7sandbox1/sites/all/themes $ drush vset -y theme_default bartik