elixir-lang/elixir — pull request #1738 by pragdave (2013-09-30 18:16:45+00:00)
Title: add a few extra tests

I've added a few test for what follows. I'm having trouble testing the inline ones, because IO.ANSI.escape_fragment doesn't seem to return the leading escape sequence when testing.

Anyway:

1. \*, \**, \_ and so on are only considered delimiters if they are not followed by space:

I believe the code already does this. Do you have an example where it doesn't?

2. Similar, a list is only marked as so if * is followed by space;

I think this is already there, too.

3. The current implementation doesn't work with nested lists. Here is the expected result:

iex(10)> Markdown.to_html "* foo\n * bar"
"

\n
foo\n\n

\n
bar
\n

\n

\n"

That's a bug. I'll fix it

4. A paragraph is terminated when there are two new lines and any number of spaces in between those lines. We don't consider the spaces. I saw that when a list was not showing up:

Do you have an example of this? It seems to work here.

5. Discussion: should we align the markdown paragraphs by default as we do here? That's because heredocs already do that in Elixir:

"""
foo
"""

#=> "foo\n"

Elixir takes into account the closing """. If someone writes docs like this:

"""
foo
"""

I'd rather say they should fix their docs then silently accepting it (because other tools like ExDoc won't silently accept it).

That's easy to remove if you want.