style(docs): trim the start of the documents

This commit is contained in:
Orhun Parmaksız 2021-11-16 20:10:14 +03:00
parent 0a2a8fbedc
commit d4768c5695
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -42,12 +42,16 @@ impl Paragraph {
.next()
.flatten()
.ok_or(Error::CaptureError)?;
(input[content_capture.end()..next_capture.start()])
.trim()
.to_string()
(input[content_capture.end()..next_capture.start()]).to_string()
} else {
(input[content_capture.end()..]).trim().to_string()
},
(input[content_capture.end()..]).to_string()
}
.lines()
.map(|v| v.trim_start_matches('\t'))
.collect::<Vec<&str>>()
.join("\n")
.trim()
.to_string(),
));
}
Ok(paragraphs)