Code blocks, the colon and French

Michel Fortin michel.fortin at michelf.com
Thu Mar 18 09:08:36 EST 2004


Hi,

You're right, copy-paste could put indentation to code that should not 
be treated as code block. Someone could also indent the first line of a 
paragraph for cosmetic reasons and that would result in the paragraph 
displayed as code. Example:

      This is a paragraph that has a first-line indent of four spaces. 
Since the paragraph will word-wrap, it achieve the writer's desired 
effect to makes the first line indented. This indent will not be 
translated into HTML, but that's not important as it should be decided 
by the a style sheet. The problem is that it is treated as a code block 
by Markdown while it is clearly not.

I'm not sure of the importance of this one, but it's just another 
reason why indentation alone may not be appropriate for code blocks.

What would I do? I don't know. It has to be a compromise between the 
usability/legibility of the Markdown text and trying to let people keep 
their writing (or copy-pasting) habits. I would probably go for 
indentation alone to identify a code block making sure there is a FAQ 
about these issues.

But you could also do some usability testing. A good test would be to 
setup a web page encouraging people to try translating a document they 
have (any kind of document) to the Markdown syntax. Refer them to the 
Markdown Basics page for easy learning. For people who know HTML, they 
are encouraged to put special things in HTML (anything they want) into 
the page. Also, the page must encourage users to send the document in 
their language of choice to test Markdown with multiple languages. Then 
you record the markup for any preview they make and try to figure out 
what caused a problem and by what proportion... and if you want to make 
some changes (or additions) to the syntax later you could evaluate how 
much it will get in the way people current writing habits.

Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/


Le 16 mars 2004, à 22:52, John Gruber a écrit :

> I forgot. There's one more reason why I didn't implement it this way
> already. I'm worried people inserting inline HTML with indents, and
> having it turned into a code block accidentally.
>
> The syntax docs already state that the start tag for an inline HTML
> block should not be indented.
>
> <div class='foo'>
>     <span>
>         You can indent all you want in here.
>     </span>
> </div>
>
> Thus, the above will always be treated as raw inline HTML.
>
>     <div class='foo'>
>         <span>
>             You can indent all you want in here.
>         </span>
>     </div>
>
> With the new rule, that second div, which has no preceding colon,
> will be treated as a code block.
>
> I think this makes sense, and is fair. But I'm worried about
> copy-paste bugs, where someone will copy the raw HTML they want to
> insert out of some other window, paste it into their Markdown
> article, and forget that the start tag can't be indented.
>
> Thoughts?
>
> -J.G. 


More information about the Markdown-discuss mailing list