diff --git a/components/markdown/src/markdown.rs b/components/markdown/src/markdown.rs
index a5227162f7..8bdc778e22 100644
--- a/components/markdown/src/markdown.rs
+++ b/components/markdown/src/markdown.rs
@@ -684,9 +684,7 @@ pub fn markdown_to_html(
event
});
}
- Event::Html(text) | Event::InlineHtml(text)
- if !has_summary && MORE_DIVIDER_RE.is_match(text.as_ref()) =>
- {
+ Event::Html(text) if !has_summary && MORE_DIVIDER_RE.is_match(text.as_ref()) => {
has_summary = true;
events.push(Event::Html(CONTINUE_READING.into()));
}
diff --git a/components/markdown/tests/snapshots/summary__no_truncated_summary.snap b/components/markdown/tests/snapshots/summary__no_truncated_summary.snap
new file mode 100644
index 0000000000..70c632d63f
--- /dev/null
+++ b/components/markdown/tests/snapshots/summary__no_truncated_summary.snap
@@ -0,0 +1,10 @@
+---
+source: components/markdown/tests/summary.rs
+expression: rendered.body
+---
+
Things to do:
+
+- Program something
+- Eat
+- Sleep
+
diff --git a/components/markdown/tests/snapshots/summary__truncated_summary.snap b/components/markdown/tests/snapshots/summary__truncated_summary.snap
deleted file mode 100644
index bc47a02357..0000000000
--- a/components/markdown/tests/snapshots/summary__truncated_summary.snap
+++ /dev/null
@@ -1,7 +0,0 @@
----
-source: components/markdown/tests/summary.rs
-expression: body
----
-Things to do:
-
-- Program
diff --git a/components/markdown/tests/summary.rs b/components/markdown/tests/summary.rs
index 1d6bc55ca2..39dae40996 100644
--- a/components/markdown/tests/summary.rs
+++ b/components/markdown/tests/summary.rs
@@ -1,7 +1,11 @@
mod common;
fn get_summary(content: &str) -> String {
- common::render(content).expect("couldn't render").summary.expect("had no summary")
+ get_rendered(content).summary.expect("had no summary")
+}
+
+fn get_rendered(content: &str) -> markdown::Rendered {
+ common::render(content).expect("couldn't render")
}
#[test]
@@ -44,8 +48,8 @@ And some content after
}
#[test]
-fn truncated_summary() {
- let body = get_summary(
+fn no_truncated_summary() {
+ let rendered = get_rendered(
r#"
Things to do:
* Program something
@@ -53,7 +57,8 @@ Things to do:
* Sleep
"#,
);
- insta::assert_snapshot!(body);
+ assert!(rendered.summary.is_none());
+ insta::assert_snapshot!(rendered.body);
}
#[test]