diff --git a/integration/tests_failed/assert_newline.html b/integration/tests_failed/assert_newline.html new file mode 100644 index 000000000..99302c5f9 --- /dev/null +++ b/integration/tests_failed/assert_newline.html @@ -0,0 +1,19 @@ +
# Testing trailing whitespace
+# Response '<p>Hello</p>\n\n'
+
+# Testing with a raw string
+# check exactly the whitespace
+# It should produce an assert error
+GET http://localhost:8000/error-assert-newline
+HTTP/1.0 200
+```<p>Hello</p>
+```
+
+# TODO
+# Testing with XML
+# Ignore trailing whitespace (semantic comparison)
+# It should not produce an error
+# GET http://localhost:8000/error-assert-newline
+# HTTP/1.0 200
+# <p>Hello</p>
+
diff --git a/packages/hurl_core/src/format/html.rs b/packages/hurl_core/src/format/html.rs
index 09cf0a85a..bf844be30 100644
--- a/packages/hurl_core/src/format/html.rs
+++ b/packages/hurl_core/src/format/html.rs
@@ -861,40 +861,11 @@ impl Htmlable for RawString {
fn to_html(&self) -> String {
let mut buffer = "".to_string();
buffer.push_str("");
- buffer.push_str("```");
-
- if !self.newline.value.as_str().is_empty() {
- buffer.push_str(
- format!(
- "{}",
- self.newline.value.as_str()
- )
- .as_str(),
- );
- }
-
- let mut lines: Vec