From 0d1e9bc1786886aec7e1f4ddf058b278793b928a Mon Sep 17 00:00:00 2001 From: Uttarayan Mondal Date: Thu, 16 Mar 2023 13:07:25 +0530 Subject: [PATCH] [fix] Don't exclude empty spans Empty spans might be empty new lines used in ascii art --- src/parser.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 9ede024..54efe9c 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -96,11 +96,8 @@ fn spans(style: Style) -> impl Fn(&[u8]) -> IResult<&[u8], (Spans<'static>, Styl let mut spans = Vec::new(); let mut last = style; while let Ok((s, span)) = span(last)(text) { - // don't include empty spans, provided we have at least one - if spans.len() <= 0 || span.content != "" { - last = span.style; - spans.push(span); - } + last = span.style; + spans.push(span); text = s; if text.is_empty() { break;