Abnaxos / markdown-doclet

A Doclet that allows the use of Markdown in JavaDoc comments.
GNU General Public License v3.0
319 stars 40 forks source link

A list isn't created unless there's an empty line preceding it #40

Closed slovdahl closed 8 years ago

slovdahl commented 8 years ago

This is the output produced by the code below the picture (using version 1.1.1 of pegdown-doclet):

Javadoc output

public class TestJavadoc {

    /**
     * Testing
     * - this is a list
     * - even more listing
     */
    public void test() {}

    /**
     * Testing
     *
     * - this is a list
     * - even more listing
     */
    public void test2() {}
}

Why is a line break needed before the list? It works fine without a line break on eg. github.

Testing
- this is a list
- even more listing

results in:

Testing

slovdahl commented 8 years ago

I also tested this with updated versions of pegdown and its transitive dependencies (both the official 1.5.0 version and newest git code). Still same problem.

Abnaxos commented 8 years ago

Actually, this isn't supposed to work, see the site that comes closest to a specification of Markdown. However, both versions shouldn't work. The text of your list items should be indented by 4 spaces. This is how I usually write it:

/**
 * Some text.
 *
 *  *  List items
 *  *  Another list item
 */

Not sure about the empty line before.

Anyway, this is an issue of Pegdown.

I'm surprised that Pegdown 1.5 just worked like that. I was expecting that it wouldn't even compile, let alone run, with 1.5. I'll reealuate an upgrade of Pegdown. I'm a bit short of time, though.

slovdahl commented 8 years ago

Actually, this isn't supposed to work, see the site that comes closest to a specification of Markdown.

I can't find anything about the need for a empty line before a list on http://daringfireball.net/projects/markdown/syntax#list

However, both versions shouldn't work.

I'm sorry, I don't understand. Which versions?

The text of your list items should be indented by 4 spaces.

Why? It works fine with just one space before the - sign and one after.

I'm surprised that Pegdown 1.5 just worked like that. I was expecting that it wouldn't even compile, let alone run, with 1.5. I'll reealuate an upgrade of Pegdown. I'm a bit short of time, though.

I didn't actually compile it with 1.5, I just replaced the dependency (not using pegdown-doclet-all.jar).

Abnaxos commented 8 years ago

Well, the markdown "specification" isn't really a specification, it's more like a guideline. The doclet uses Pegdown's output.

Please report to the Pegdown project: https://github.com/sirthias/pegdown