there's no payoff in confusing the users

Bowerbird at Bowerbird at
Thu Dec 1 11:37:50 EST 2011

john said:

> Have you considered using a PEG instead of regexes?

for all you home-schooled and self-taught programmers
for whom "peg" is far too computer-sciencey for comfort,
consider as an alternative the simple methodology i use...

i split the text-file on blank lines and place it in an array.

that is first-cut for my light-markup format, a.k.a., "zml"
-- zen markup language -- but it's alright with me if you
markdown people want to borrow it for your own purpose.

i mean, seriously, it's not like i could patent it, or anything.
(but, on second thought, perhaps i _should_ at least apply.)

then i walk the array, analyzing each item to see what it is;
the chunk might get tagged as a blockquote, or a heading,
or a list item, or a plain old paragraph, or _whatever_ it is.

then i walk the array again, using the tag for each chunk to
generate the appropriate output for the desired format(s)...

(sometimes the tag, or the output, is dependent upon the
surrounding chunks, and that's the reason i walk it twice.)

it's the methodology of a simpleton, i am the first to admit,
but it works, and it works well, and it works sufficiently fast.

best of all, for me, is that it's extremely easy to understand.

even better, for everyone: it's easy for users to understand.

after all, there's no payoff in confusing the users. is there?


p.s. "alright" is a word i like to use... it's akin to "already"...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Markdown-Discuss mailing list