Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/weaver_forge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,6 @@ The resulting comment in JavaDoc format would be:
* This is a note about the attribute {@code attr}. It can be multiline.
* <p>
* It can contain a list:
* <p>
* <ul>
* <li>item <strong>1</strong>,
* <li>lorem ipsum dolor sit amet, consectetur
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
* <p>
* If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
* it's RECOMMENDED to:
* <p>
* <ul>
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
Expand All @@ -77,7 +76,6 @@
* This is a note about the attribute {@code attr}. It can be multiline.
* <p>
* It can contain a list:
* <p>
* <ul>
* <li>item <strong>1</strong>,
* <li>lorem ipsum dolor sit amet, consectetur
Expand Down
7 changes: 0 additions & 7 deletions crates/weaver_forge/src/extensions/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ it's RECOMMENDED to:
* <p>
* If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
* it's RECOMMENDED to:
* <p>
* <ul>
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
Expand Down Expand Up @@ -395,7 +394,6 @@ it's RECOMMENDED to:
* <p>
* If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
* it's RECOMMENDED to:
* <p>
* <ul>
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
Expand Down Expand Up @@ -426,7 +424,6 @@ it's RECOMMENDED to:
* <p>
* If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
* it's RECOMMENDED to:
* <p>
* <ul>
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
Expand Down Expand Up @@ -457,7 +454,6 @@ it's RECOMMENDED to:
* <p>
* If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
* it's RECOMMENDED to:
* <p>
* <ul>
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not
Expand All @@ -476,15 +472,13 @@ it's RECOMMENDED to:
* The {@code error.type}
* SHOULD be predictable, and
* SHOULD have low cardinality.
*
* <p>
* When {@code error.type} is
* set to a type (e.g., an
* exception type), its
* canonical class name
* identifying the type within
* the artifact SHOULD be used.
*
* <p>
* Instrumentations SHOULD
* document the list of errors
Expand Down Expand Up @@ -514,7 +508,6 @@ it's RECOMMENDED to:
* identifiers (such as HTTP or
* gRPC status codes), it's
* RECOMMENDED to:
* <p>
* <ul>
* <li>Use a domain-specific
* attribute
Expand Down
16 changes: 9 additions & 7 deletions crates/weaver_forge/src/formats/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct RenderContext {
// node following the current one in the AST traversal. This field contains
// such a tag left by the previous node, which must be added by the current
// node during rendering, if it exists.
leftover_tag: Option<String>,
add_old_style_paragraph: bool,

// Context for wrapping words.
word_wrap: WordWrapContext,
Expand All @@ -80,7 +80,7 @@ impl RenderContext {
fn new(cfg: &WordWrapConfig) -> Self {
Self {
html: Default::default(),
leftover_tag: Default::default(),
add_old_style_paragraph: Default::default(),
word_wrap: WordWrapContext::new(cfg),
}
}
Expand Down Expand Up @@ -243,8 +243,12 @@ impl<'source> HtmlRenderer<'source> {
format: &str,
options: &HtmlRenderOptions,
) -> Result<(), Error> {
if let Some(tag) = ctx.leftover_tag.take() {
ctx.push_unbroken_ln(&tag, indent)?;
if ctx.add_old_style_paragraph {
ctx.pushln(indent)?;
if !matches!(md_node, Node::List(_)) {
ctx.push_unbroken_ln("<p>", indent)?;
}
ctx.add_old_style_paragraph = false;
}

match md_node {
Expand All @@ -264,7 +268,7 @@ impl<'source> HtmlRenderer<'source> {
self.write_html_to(ctx, indent, child, format, options)?;
}
if options.old_style_paragraph {
ctx.leftover_tag = Some("\n<p>".to_owned());
ctx.add_old_style_paragraph = true;
} else {
ctx.push_unbroken_ln("</p>", indent)?;
}
Expand Down Expand Up @@ -544,7 +548,6 @@ If the operation has completed successfully, instrumentations SHOULD NOT set {@c
<p>
If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes),
it's RECOMMENDED to:
<p>
<ul>
<li>Use a domain-specific attribute
<li>Set {@code error.type} to capture all errors, regardless of whether they are defined within the domain-specific set or not.
Expand Down Expand Up @@ -766,7 +769,6 @@ its own set of error
identifiers (such as HTTP or
gRPC status codes), it's
RECOMMENDED to:
<p>
<ul>
<li>Use a domain-specific
attribute
Expand Down
Loading