|
|
@ -113,12 +113,19 @@ impl ParseInline for Parser {
|
|
|
|
let start_index = self.ctm.get_index();
|
|
|
|
let start_index = self.ctm.get_index();
|
|
|
|
self.ctm.seek_any(&INLINE_WHITESPACE)?;
|
|
|
|
self.ctm.seek_any(&INLINE_WHITESPACE)?;
|
|
|
|
|
|
|
|
|
|
|
|
let mut description = String::new();
|
|
|
|
let mut description = Vec::new();
|
|
|
|
|
|
|
|
|
|
|
|
if self.ctm.check_char(&DESC_OPEN) {
|
|
|
|
if self.ctm.check_char(&DESC_OPEN) {
|
|
|
|
self.ctm.seek_one()?;
|
|
|
|
self.ctm.seek_one()?;
|
|
|
|
description =
|
|
|
|
self.inline_break_at.push(DESC_CLOSE);
|
|
|
|
self.ctm
|
|
|
|
|
|
|
|
.get_string_until_any_or_rewind(&[DESC_CLOSE], &[LB], start_index)?;
|
|
|
|
while let Ok(inline) = self.parse_inline() {
|
|
|
|
|
|
|
|
description.push(inline);
|
|
|
|
|
|
|
|
if self.ctm.check_char(&DESC_CLOSE) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
self.inline_break_at.pop();
|
|
|
|
} else if !short_syntax {
|
|
|
|
} else if !short_syntax {
|
|
|
|
return Err(self.ctm.rewind_with_error(start_index));
|
|
|
|
return Err(self.ctm.rewind_with_error(start_index));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -133,10 +140,10 @@ impl ParseInline for Parser {
|
|
|
|
|
|
|
|
|
|
|
|
self.ctm.seek_one()?;
|
|
|
|
self.ctm.seek_one()?;
|
|
|
|
|
|
|
|
|
|
|
|
if description.is_empty() {
|
|
|
|
if description.len() > 0 {
|
|
|
|
Ok(Url::new(None, url))
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Ok(Url::new(Some(description), url))
|
|
|
|
Ok(Url::new(Some(description), url))
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Ok(Url::new(None, url))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|