fix(title): fix is_commented to recognize any whitespaces (#21)

This commit is contained in:
PoiScript 2020-05-10 01:46:09 +08:00
parent b482dcb2d4
commit 1f53a8c244

View file

@ -83,7 +83,8 @@ impl Title<'_> {
/// Returns `true` if this headline is commented
pub fn is_commented(&self) -> bool {
self.raw.starts_with("COMMENT ") || self.raw == "COMMENT"
self.raw.starts_with("COMMENT")
&& (self.raw.len() == 7 || self.raw[7..].starts_with(char::is_whitespace))
}
pub fn into_owned(self) -> Title<'static> {