Re: Syntax Questions

2008-07-18 Thread Michel Fortin

Le 2008-07-18 à 5:13, Jurgens du Toit a écrit :


Kewl.

If you look at a formatter like tidy, it's got a lot of options  
where you
can turn certain behaviour on and off, making it much more useable  
for a lot
of people. Wouldn't it improve the usability of Markdown if these  
kind of

options were present?


The more options, the more difficult to test, because each input can  
have more than one output. There are some configurable things in PHP  
Markdown, but I can attest they are under-tested compared to the  
regular syntax.


Moreover, with each option affecting how the Markdown source is  
parsed, you multiply per two the number of variants of the language in  
the wild. Currently, if I encounter a text box on a web page claiming  
to be Markdown-formatted I can be pretty sure of the output I'll get  
for what I write. If Markdown had one option turning each newline in  
one HTML line break, then writing in that textbox is guesswork.  
Hopefully, the form author will tell which options are on and which  
are off -- something like "Markdown + automatic line breaks" in our  
case -- but the more options, the less practical it is for authors to  
write this extra info, or for users to read it, because the length of  
the description would become intimidating.


Which means that if you modify Markdown to change some of its  
behaviour, please don't call it plainly "Markdown". "Markdown +  
automatic line breaks" explains clearly what your text field does  
differently from Markdown and will avoid surprises for your visitors.


 - - -

Now, if you still want to do a hard break at each newline with PHP  
Markdown, go to the `doHardBreaks` function and change this expression:


/ {2,}\n/

for this one:

/\n/

and I expect it should do the trick. This is totally untested however.  
And I don't plan to add an option like this to future versions.



Michel Fortin
[EMAIL PROTECTED]
http://michelf.com/


___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Syntax Questions

2008-07-18 Thread Jurgens du Toit
Kewl.

If you look at a formatter like tidy, it's got a lot of options where you
can turn certain behaviour on and off, making it much more useable for a lot
of people. Wouldn't it improve the usability of Markdown if these kind of
options were present?

J

On Fri, Jul 18, 2008 at 3:50 AM, Michel Fortin <[EMAIL PROTECTED]>
wrote:

> Le 2008-07-17 à 16:41, Jan Erik Moström a écrit :
>
>  Well, there is a good reason why Markdown doesn't do this. Many prefer to
>> use a plain text editor which doesn't wrap text (I for example prefer my
>> text files this way) and we insert hard new lines to keep the lines from
>> becoming too long. If those hard newlines were translated into 
>> Markdown would be useless for a lot of people.
>>
>
> That's one reason. Personally, I often generally don't write hard-wrapped
> paragraphs... except inside lists and blockquotes where I wants things
> aligned properly in the source text.
>
> For instance, I don't want my text editor to wrap automatically my like
> item like this:
>
>1.  First item of a list with two lines worth wasted text
>for your reading pleasure.
>
> So I indent correctly the second line to make it better looking and easier
> to write:
>
>1.  First item of a list with two lines worth wasted text
>for your reading pleasure.
>
> By doing this, I'm inserting a newline character at the end of each line.
> If Markdown was adding a line break there, then I'd be forced to write the
> bad-looking version, reducing readability of the source text.
>
> The same applies to blockquotes:
>
>> This and that and this and that and this
>> and that and this.
>
> You couldn't indent each line with a ">" if Markdown was to convert every
> newline to a ``.
>
>
>  (and I don't think there is an option to get it to behave the way you
>> want)
>>
>
>
> No there isn't one.
>
>
> Michel Fortin
> [EMAIL PROTECTED]
> http://michelf.com/
>
>
> ___
> Markdown-Discuss mailing list
> Markdown-Discuss@six.pairlist.net
> http://six.pairlist.net/mailman/listinfo/markdown-discuss
>



-- 
Jurgens du Toit
Cell: +27 83 511 7932
Fax: +27 86 503 2637
Website: www.jrgns.net

If people never did silly things, nothing intelligent would ever get done.
- Ludwig Wittgenstein
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss