From fed8edc44fc68b44096016c2ab51b3d1cbc0b6ee Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 5 Dec 2024 19:43:14 -0800 Subject: [PATCH] Javadoc p tags should only precede paragraphs --- crates/weaver_forge/README.md | 2 -- crates/weaver_forge/expected_output/comment_format/example.java | 2 -- crates/weaver_forge/src/formats/html.rs | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/weaver_forge/README.md b/crates/weaver_forge/README.md index 42f4993c..cbd5f25a 100644 --- a/crates/weaver_forge/README.md +++ b/crates/weaver_forge/README.md @@ -768,7 +768,6 @@ The resulting comment in JavaDoc format would be: * incididunt ut labore et dolore magna aliqua. * * And an inline code snippet: {@code Attr.attr}. - *

*

Summary

*

Examples

*
    @@ -791,7 +790,6 @@ The resulting comment in JavaDoc format would be: * Lorem ipsum dolor sit amet, consectetur adipiscing * elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. * - *

    *

    * [!NOTE] Something very important here
    */ diff --git a/crates/weaver_forge/expected_output/comment_format/example.java b/crates/weaver_forge/expected_output/comment_format/example.java index c657c358..72619fa9 100644 --- a/crates/weaver_forge/expected_output/comment_format/example.java +++ b/crates/weaver_forge/expected_output/comment_format/example.java @@ -87,7 +87,6 @@ * incididunt ut labore et dolore magna aliqua. * * And an inline code snippet: {@code Attr.attr}. - *

    *

    Summary

    *

    Examples

    *
      @@ -110,7 +109,6 @@ * Lorem ipsum dolor sit amet, consectetur adipiscing * elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. * - *

      *

      * [!NOTE] Something very important here
      */ diff --git a/crates/weaver_forge/src/formats/html.rs b/crates/weaver_forge/src/formats/html.rs index 59c427bf..36978e47 100644 --- a/crates/weaver_forge/src/formats/html.rs +++ b/crates/weaver_forge/src/formats/html.rs @@ -245,7 +245,7 @@ impl<'source> HtmlRenderer<'source> { ) -> Result<(), Error> { if ctx.add_old_style_paragraph { ctx.pushln(indent)?; - if !matches!(md_node, Node::List(_)) { + if matches!(md_node, Node::Paragraph(_)) { ctx.push_unbroken_ln("

      ", indent)?; } ctx.add_old_style_paragraph = false;