Implement the new fields for citation.
This commit is contained in:
@@ -46,16 +46,22 @@ pub(crate) fn citation<'b, 'g, 'r, 's>(
|
||||
let (remaining, prefix) =
|
||||
must_balance_bracket(opt(parser_with_context!(global_prefix)(context)))(remaining)?;
|
||||
|
||||
let contents_begin = remaining;
|
||||
let (remaining, references) =
|
||||
separated_list1(tag(";"), parser_with_context!(citation_reference)(context))(remaining)?;
|
||||
let contents_end = {
|
||||
let (rem, _) = opt(tag(";"))(remaining)?;
|
||||
rem
|
||||
};
|
||||
let (remaining, suffix) = must_balance_bracket(opt(map(
|
||||
tuple((tag(";"), parser_with_context!(global_suffix)(context))),
|
||||
|(_, suffix)| suffix,
|
||||
)))(remaining)?;
|
||||
let (remaining, _) = tag("]")(remaining)?;
|
||||
let (remaining, _trailing_whitespace) =
|
||||
let (remaining, post_blank) =
|
||||
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||
let source = get_consumed(input, remaining);
|
||||
let contents = contents_begin.get_until(contents_end);
|
||||
Ok((
|
||||
remaining,
|
||||
Citation {
|
||||
@@ -64,6 +70,8 @@ pub(crate) fn citation<'b, 'g, 'r, 's>(
|
||||
prefix: prefix.unwrap_or(Vec::new()),
|
||||
suffix: suffix.unwrap_or(Vec::new()),
|
||||
children: references,
|
||||
contents: Into::<&str>::into(contents),
|
||||
post_blank: post_blank.map(Into::<&str>::into),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user