You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FIXME: would add a test that includes newlines, but due to the way pulldown-cmark parses HTML nodes, these are passed as separate HTML events. see: https://github.com/raphlinus/pulldown-cmark/issues/803
667
+
let mores =
668
+
["<!-- more -->", "<!--more-->", "<!-- MORE -->", "<!--MORE-->", "<!--\t MoRe \t-->"];
669
+
let config = Config::default();
670
+
let context = RenderContext::from_config(&config);
671
+
for more in mores {
672
+
let content = format!("{top}\n\n{more}\n\n{bottom}");
673
+
let rendered = markdown_to_html(&content, &context, vec![]).unwrap();
674
+
assert!(rendered.summary_len.is_some(), "no summary when splitting on {more}");
675
+
let summary_len = rendered.summary_len.unwrap();
676
+
let summary = &rendered.body[..summary_len].trim();
677
+
let body = &rendered.body[summary_len..].trim();
678
+
let continue_reading = &body[..CONTINUE_READING.len()];
679
+
let body = &body[CONTINUE_READING.len()..].trim();
0 commit comments