Colon before Code Blocks

Craig Morgan craig.morgan at sun.com
Thu Mar 25 06:11:12 EST 2004


Alexander,

See John's earlier response (quoted below) amongst a dicsussion of 
intermingled code blocks and lists ...

> I'm not sure what I'll end up doing here.
> 
> For sure, Markdown should never produce invalid markup like what's
> coming out of your example. There are always going to be edge cases
> where Markdown doesn't do exactly what you hope it does, but at the
> very least, it should always generate valid XHTML.
> 
> One thing I discussed last week is that I'm not happy with
> Markdown's current syntax for code blocks. The rules about colons
> are just too complicated. So, soon, the rule is going to change so
> that code blocks are simply indented blocks of text. No special
> rules at all about preceding colons. If a block is indented by 4
> spaces/1 tab, then it's a code block.
> 
> I'm not sure at this point what the rule will be about having blank
> lines before and after a code block, however. No matter what,
> though, the rules for blank lines before and/or after code blocks
> will be clearly defined.
> 
> Perhaps I can work it out so that, in general, code blocks will
> require a blank line before and after, but within a list item, you
> will be able to use them without blank lines, so you can insert a
> `<pre>` block within the `<li>` without having in-list `<p>` tags.

HTH

Craig

Alexander Johannes wrote:

> Hello,
> 
> i cant see why it is necessary to put a colon before the paragraph,  
> that should be formatted as a code block. I know, that i can put a  
> space before the colon, so that it dont appears in the output, but i  
> also would like to provide the pure markdown-formatted text to post it  
> to the usenet, or print it. In this cases, the single colon occurs a  
> little bit misplaced. Currently i'm reformatting  
> <http://faq.de-soc-mac.de/> to use Markdown and i found several  
> articles, where i have to put a colon before a code block, though it  
> wouldn't be necessary, when you consider the context of the paragraph  
> or sentence.
> Maybe i should provide an example°, even if it is in german:
> 
> ----
> Durch die Eingabe von
> 
>     sudo diskutil disableJournal /
> 
> kann man diese Aktion rückgängig machen.
> ----
> 
> This is better readable than typing
> 
> ----
> Durch die Eingabe von `sudo diskutil disableJournal /` kann man diese  
> Aktion rückgängig machen.
> ----
> 
> At the moment i have to write
> 
> ----
> Durch die Eingabe von :
> 
>     sudo diskutil disableJournal /
> 
> kann man diese Aktion rückgängig machen.
> ----
> 
> to force Markdown to format the second line as exspected. This is  
> semantically wrong.
> 
> To come to an end: is there a technical reason, doing it this way, or  
> do i have to exspect a change in a future Release of Markdown? If it  
> has already discussed at the past, i would be glad, if you point me to  
> that discussion in the archive.
> 
> Apart from that, i'm very happy with Markdown, because i felt instantly  
> home, wehen i started using it. Thanks for the great work :)!
> 
> Alex
> 
> °) The example is taken from  <http://faq.de-soc-mac.de/systempflege/ 
> wie_verhalte_ich_mich_nach_einem_systemabsturz_unter_os_x.shtml> resp.  
> <http://faq.de-soc-mac.de/systempflege/ 
> wie_verhalte_ich_mich_nach_einem_systemabsturz_unter_os_x.text>.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Markdown-discuss mailing list
> Markdown-discuss at six.pairlist.net
> http://six.pairlist.net/mailman/listinfo/markdown-discuss


-- 
Craig

Craig Morgan                              Sun Microsystems Ltd
Senior Training Instructor                Enterprise Services
SES UK                                    Citygate
                                           Cross Street
Email:  craig.morgan at sun.com              Sale, Cheshire
Tel:    +44 (0)161 905 8155               UK
Fax:    +44 (0)161 962 4150               M33 7JF

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  NOTICE:  This email message is for the sole use of the intended
  recipient(s) and may contain confidential and privileged information.
  Any unauthorized review, use, disclosure or distribution is prohibited.
  If you are not the intended recipient, please contact the sender by
  reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Markdown-discuss mailing list