From d88b75fa92f21f15146bfa486e5127f899b0736c Mon Sep 17 00:00:00 2001
From: Trask Stalnaker ", indent)?;
}
@@ -270,8 +277,9 @@ impl<'source> HtmlRenderer<'source> {
if options.old_style_paragraph {
ctx.add_old_style_paragraph = true;
} else {
- ctx.push_unbroken_ln("
* [!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 f4293ba5..5152f4bb 100644
--- a/crates/weaver_forge/expected_output/comment_format/example.java
+++ b/crates/weaver_forge/expected_output/comment_format/example.java
@@ -109,7 +109,6 @@
* It can contain multiple lines.
* 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 51e651be..ea8192a4 100644
--- a/crates/weaver_forge/src/formats/html.rs
+++ b/crates/weaver_forge/src/formats/html.rs
@@ -65,6 +65,9 @@ struct RenderContext {
// The rendered HTML.
html: String,
+ // Add a newline before rendering the next node.
+ add_newline: bool,
+
// The rendering process traverses the AST tree in a depth-first manner.
// In certain circumstances, a tag should only be rendered if there is a
// node following the current one in the AST traversal. This field contains
@@ -80,6 +83,7 @@ impl RenderContext {
fn new(cfg: &WordWrapConfig) -> Self {
Self {
html: Default::default(),
+ add_newline: Default::default(),
add_old_style_paragraph: Default::default(),
word_wrap: WordWrapContext::new(cfg),
}
@@ -243,8 +247,11 @@ impl<'source> HtmlRenderer<'source> {
format: &str,
options: &HtmlRenderOptions,
) -> Result<(), Error> {
- if ctx.add_old_style_paragraph {
+ if ctx.add_newline {
ctx.pushln(indent)?;
+ ctx.add_newline = false;
+ }
+ if ctx.add_old_style_paragraph {
if matches!(md_node, Node::Paragraph(_)) {
ctx.push_unbroken_ln("
* And an inline code snippet: {@code Attr.attr}. *
* And something more */ static ERROR_TYPE = ""; @@ -87,6 +88,7 @@ * adipiscing elit sed do eiusmod tempor * incididunt ut labore et dolore magna aliqua. * + *
* And an inline code snippet: {@code Attr.attr}. *
* And something more */"## ); @@ -401,6 +402,7 @@ And something more.. "#; *
* And something more */"## ); @@ -432,6 +434,7 @@ And something more.. "#; *
* And something more */"## ); @@ -463,6 +466,7 @@ And something more.. "#; *
* And something more */"## ); @@ -523,6 +527,7 @@ And something more.. "#; * are defined within the * domain-specific set or not * + *
* And something more */"## ); diff --git a/crates/weaver_forge/src/formats/html.rs b/crates/weaver_forge/src/formats/html.rs index ea8192a4..7de5de47 100644 --- a/crates/weaver_forge/src/formats/html.rs +++ b/crates/weaver_forge/src/formats/html.rs @@ -296,6 +296,9 @@ impl<'source> HtmlRenderer<'source> { ctx.pushln(indent)?; ctx.push_unbroken(&format!("{}>", tag), indent)?; ctx.add_newline = true; + if options.old_style_paragraph { + ctx.add_old_style_paragraph = true; + } } Node::ListItem(item) => { for child in &item.children { @@ -564,6 +567,7 @@ it's RECOMMENDED to:
And something more."## ); Ok(()) @@ -792,6 +796,7 @@ RECOMMENDED to: are defined within the domain-specific set or not +
And something more."##
);
Ok(())
From 5fecae9bfb1361af948b31b9a117752566196509 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 6 Dec 2024 16:46:23 -0500
Subject: [PATCH 4/4] chore(deps): bump alpine from 3.20.3 to 3.21.0 (#513)
Bumps alpine from 3.20.3 to 3.21.0.
---
updated-dependencies:
- dependency-name: alpine
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]