Skip to main content
2 of 4
deleted 2 characters in body
dessert
  • 40.7k
  • 17
  • 36

My two cents to just those two points you raised:

  • users may mistakenly take in code comments as part of the provided solution

    The syntax highlighting prevents that very well, for example:

      #!/bin/bash
      a=~/dir # fill variable a
    

    Unfortunately syntax highlighting doesn’t seem to work here on meta, but on main the comment would appear greyed out if the code block was preceded by <!-- language: lang-bash -->.

  • its not easy to point to a specific code section without repeating it in the text

    You can use the usual formatting inside code blocks if you use the html markup, e.g.

      <pre><code>#!/bin/<i>bash</i> # italics
      a=<b>~/dir</b> # bold</code></pre>
    

    gives:

    #!/bin/bash # italics
      a=~/dir # bold
dessert
  • 40.7k
  • 17
  • 36