Skip to content

Commit c5c66ba

Browse files
trasklquerel
andauthored
Javadoc p tags should only precede paragraphs (#510)
Co-authored-by: Laurent Quérel <[email protected]>
1 parent 03e0f51 commit c5c66ba

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

crates/weaver_forge/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ The resulting comment in JavaDoc format would be:
768768
* incididunt ut labore et dolore magna aliqua.
769769
* </ul>
770770
* And an <strong>inline code snippet</strong>: {@code Attr.attr}.
771-
* <p>
772771
* <h1>Summary</h1>
773772
* <h2>Examples</h2>
774773
* <ol>
@@ -791,7 +790,6 @@ The resulting comment in JavaDoc format would be:
791790
* Lorem ipsum dolor sit amet, consectetur adipiscing
792791
* elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</blockquote>
793792
*
794-
* <p>
795793
* <blockquote>
796794
* [!NOTE] Something very important here</blockquote>
797795
*/

crates/weaver_forge/expected_output/comment_format/example.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
* incididunt ut labore et dolore magna aliqua.
8989
* </ul>
9090
* And an <strong>inline code snippet</strong>: {@code Attr.attr}.
91-
* <p>
9291
* <h1>Summary</h1>
9392
* <h2>Examples</h2>
9493
* <ol>
@@ -111,7 +110,6 @@
111110
* Lorem ipsum dolor sit amet, consectetur adipiscing
112111
* elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</blockquote>
113112
*
114-
* <p>
115113
* <blockquote>
116114
* [!NOTE] Something very important here</blockquote>
117115
*/

crates/weaver_forge/src/formats/html.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl<'source> HtmlRenderer<'source> {
245245
) -> Result<(), Error> {
246246
if ctx.add_old_style_paragraph {
247247
ctx.pushln(indent)?;
248-
if !matches!(md_node, Node::List(_)) {
248+
if matches!(md_node, Node::Paragraph(_)) {
249249
ctx.push_unbroken_ln("<p>", indent)?;
250250
}
251251
ctx.add_old_style_paragraph = false;

0 commit comments

Comments
 (0)