Skip to content

Commit fbf5091

Browse files
committed
Minor cleanups
1 parent 69e3f07 commit fbf5091

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/html/markdown.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ fn stripped_filtered_line<'a>(s: &'a str) -> Option<&'a str> {
6464
}
6565
}
6666

67-
/// Returns a new string with all consecutive whitespace collapsed into
68-
/// single spaces.
69-
///
70-
/// Any leading or trailing whitespace will be trimmed.
71-
#[allow(dead_code)]
72-
fn collapse_whitespace(s: &str) -> String {
73-
s.split_whitespace().collect::<Vec<_>>().join(" ")
74-
}
75-
7667
thread_local!(pub static PLAYGROUND_KRATE: RefCell<Option<Option<String>>> = {
7768
RefCell::new(None)
7869
});
@@ -285,11 +276,9 @@ pub fn plain_summary_line(md: &str) -> String {
285276
let events = Parser::new(md).map(|ev| match ev {
286277
CmEvent::Start(Tag::Code) => CmEvent::Text(Cow::Borrowed("`")),
287278
CmEvent::End(Tag::Code) => CmEvent::Text(Cow::Borrowed("`")),
288-
CmEvent::Start(Tag::Link(_, text)) => CmEvent::Text(text),
289-
CmEvent::Start(Tag::Image(_, text)) => CmEvent::Text(text),
290-
CmEvent::Html(html) | CmEvent::InlineHtml(html) => CmEvent::Text(html),
291-
ev @ CmEvent::Text(_) => ev,
292-
_ => CmEvent::Html(Cow::Borrowed("")),
279+
CmEvent::Text(_) => ev,
280+
//CmEvent::SoftBreak | CmEvent::HardBreak => ev,
281+
_ => CmEvent::Text(Cow::Borrowed("")),
293282
});
294283

295284
let hm_toks = cmark_hamlet::Adapter::new(events, false);

0 commit comments

Comments
 (0)