diff --git a/src/line/code/multiline.rs b/src/line/code/multiline.rs index af92cf6..cef1518 100644 --- a/src/line/code/multiline.rs +++ b/src/line/code/multiline.rs @@ -11,10 +11,10 @@ impl Multiline { /// return Self constructed on success or None pub fn begin_from(line: &str) -> Option { if line.starts_with("```") { - let alt = line.trim_start_matches("```"); + let alt = line.trim_start_matches("```").trim(); return Some(Self { - alt: match alt.trim().is_empty() { + alt: match alt.is_empty() { true => None, false => Some(GString::from(alt)), }, diff --git a/tests/integration.rs b/tests/integration.rs index 494a5b9..475398a 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -93,7 +93,7 @@ fn gemtext() { { let item = code_multiline.get(0).unwrap(); - assert_eq!(item.alt.clone().unwrap(), " alt text"); + assert_eq!(item.alt.clone().unwrap(), "alt text"); assert_eq!(item.buffer.len(), 3); assert_eq!(item.buffer.get(0).unwrap(), "multi"); assert_eq!(item.buffer.get(1).unwrap(), " preformatted line");