What version of OpenRewrite are you using?
I am using
- OpenRewrite main branch
- Maven/Gradle plugin 6.41.0
- rewrite-migrate-java_ 3.36.0
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a mult-module project.
<profile>
<id>openrewrite</id>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>6.41.0</version>
<configuration>
<exportDatatables>true</exportDatatables>
<activeRecipes>
<recipe>org.openrewrite.java.migrate.lang.JavadocToMarkdownDocComment</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<version>3.36.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
What is the smallest, simplest way to reproduce the problem?
@Test
public void codeClassShouldBeAddedToMarkdown() {
rewriteRun(
spec -> spec.recipe(new JavadocToMarkdownDocComment()),
java(
"""
class Test {
/**
* Examples:
* <pre><code class='java'>
* // assertion succeeds:
* assertThat("foo").isEqualTo("foo");
* </code></pre>
*/
public void withErrorMessageForFields() {
}
}
""",
"""
class Test {
/// Examples:
/// ```java
/// // assertion succeeds:
/// assertThat("foo").isEqualTo("foo");
/// ```
public void withErrorMessageForFields() {
}
}
""")
);
}
What did you expect to see?
see above
What did you see instead?
@Test
public void codeClassShouldBeAddedToMarkdown() {
rewriteRun(
spec -> spec.recipe(new JavadocToMarkdownDocComment()),
java(
"""
class Test {
/**
* Examples:
* <pre><code class='java'>
* // assertion succeeds:
* assertThat("foo").isEqualTo("foo");
* </code></pre>
*/
public void withErrorMessageForFields() {
}
}
""",
"""
class Test {
/// Examples:
/// ```<code class='java'>
/// // assertion succeeds:
/// assertThat("foo").isEqualTo("foo");
/// ```
public void withErrorMessageForFields() {
}
}
</code>""")
);
}
What is the full stack trace of any errors you encountered?
I will try to provide a fix, too.
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a mult-module project.
What is the smallest, simplest way to reproduce the problem?
What did you expect to see?
see above
What did you see instead?
What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?
I will try to provide a fix, too.