Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with params with multi-line descriptions #1

Open
sfrenkiel opened this issue May 24, 2016 · 6 comments
Open

Issue with params with multi-line descriptions #1

sfrenkiel opened this issue May 24, 2016 · 6 comments
Labels

Comments

@sfrenkiel
Copy link

sfrenkiel commented May 24, 2016

Thanks for putting this tool together, it's been very useful for us. One small issue--

Params that have multiple lines of description result in bad markdown with your tool. Note the following class:

public class Test
{
    /**
     *
     * @param i single line description
     */
    public void method1(int i) {}

    /**
     *
     * @param i line1
     *          line2
     */
    public void method2(int i) {}
}

The markdown for method1 is good. In the markdown for method2, the word 'line2' comes before line1. This is a problem for us with params that have very long descriptions.

@ocram ocram added the bug label May 26, 2016
@ocram
Copy link
Contributor

ocram commented May 26, 2016

Thank you so much!

This should have been fixed in e1ea5a0 now :) Can you try, please?

@elifoster
Copy link

I just tested this, the result is:

Documentation

public void method1(int i)

  • Parameters: i — single line description

public void method2(int i)

  • Parameters: i — line1

    line2

I'm not certain that is exactly what should be expected. I believe it should result in:

Documentation

public void method1(int i)

  • Parameters: i — single line description

public void method2(int i)

  • Parameters: i — line1 line2

Or something similar.

@ocram
Copy link
Contributor

ocram commented Oct 7, 2016

@elifoster Thanks, that looks good! I understand that you might prefer another way of formatting the output, but your test proved that our fix to @sfrenkiel's original problem works correctly.

Personally, I prefer

line1

line2

to

line1 line2

for multi-line descriptions where the first version preserves the formatting from the source. You seem to disagree here, however. Do you have some example where your formatting makes more sense? Thank you!

@ocram ocram closed this as completed Oct 7, 2016
@elifoster
Copy link

If the description happens to span multiple lines due to length, that is how it would be formatted in te source. Likewise with method descriptions and class descriptions which j2md already handles this way. That line break should be added for <br>s and line gaps.

For example

/**
 * @param a This method parameter is slightly complicated, and
 *         as such it spans multiple lines.
 */

would be expected to be a single line in the resulting markdown.

@ocram
Copy link
Contributor

ocram commented Oct 15, 2016

You're right, thanks!

What about the following way of formatting the output?

Becomes single-line description in Markdown:

/**
 * @param a This method parameter is slightly complicated, and
 *          as such it spans multiple lines.
 */

Becomes multi-line description in Markdown:

/**
 * @param a This method parameter is slightly complicated, and
 *
 *          as such it spans multiple lines.
 */
/**
 * @param a This method parameter is slightly complicated, and
 *          <br>
 *          as such it spans multiple lines.
 */
/**
 * @param a This method parameter is slightly complicated, and
 *          <p>
 *          as such it spans multiple lines.
 */

@ocram ocram reopened this Oct 15, 2016
@elifoster
Copy link

Yes that would be more consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants