jsweet icon indicating copy to clipboard operation
jsweet copied to clipboard

Indentation in comments is lost in transpilation

Open apaatsio opened this issue 3 years ago • 1 comments

Indentation in comments is lost in transpilation. JavaDocs often contain indented HTML or they can have code samples where the indentation is preferable to preserve.

To reproduce:

Transpile the following Java class to TypeScript:

/**
 * <ul>
 *   <li>Hello
 *   <li>World
 * </ul>
 */
public class Foo {}

Actual result:

/* Generated from Java with JSweet 2.2.0-SNAPSHOT - http://www.jsweet.org */
/**
 * <ul>
 * <li>Hello
 * <li>World
 * </ul>
 * @class
 */
class Foo {}
Foo["__class"] = "Foo";

Expected result:

/* Generated from Java with JSweet 2.2.0-SNAPSHOT - http://www.jsweet.org */
/**
 * <ul>
 *   <li>Hello
 *   <li>World
 * </ul>
 * @class
 */
class Foo {}
Foo["__class"] = "Foo";

JSweet version used: http://www.jsweet.org/jsweet-live-sandbox/

apaatsio avatar Aug 31 '20 12:08 apaatsio

Thanks for reporting.

Do you want to take a look and submit PR?

lgrignon avatar Sep 01 '20 07:09 lgrignon