Bold not getting detected.
This commit is contained in:
@@ -24,6 +24,7 @@ use nom::error::VerboseError;
|
||||
use nom::multi::many_till;
|
||||
use nom::sequence::tuple;
|
||||
use nom::IResult;
|
||||
use tracing::instrument;
|
||||
|
||||
fn flat_text_element<'s, 'r>(
|
||||
i: &'s str,
|
||||
@@ -44,21 +45,21 @@ fn flat_text_element<'s, 'r>(
|
||||
))(i)
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
fn recognize_bold_end(input: &str) -> Res<&str, &str> {
|
||||
recognize(bold_end)(input)
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
fn flat_bold<'s, 'r>(i: &'s str, context: &'r OrgModeContext<'r>) -> Res<&'s str, TextElement<'s>> {
|
||||
let new_context = context.with_additional_fail_matcher(&recognize_bold_end);
|
||||
let text_element_parser = parser_with_context!(flat_text_element)(&new_context);
|
||||
let (remaining, captured) = recognize(tuple((
|
||||
bold_start,
|
||||
many_till(text_element_parser, bold_end),
|
||||
bold_end
|
||||
bold_end,
|
||||
)))(i)?;
|
||||
let ret = TextElement::Bold(Bold {
|
||||
contents: captured
|
||||
});
|
||||
let ret = TextElement::Bold(Bold { contents: captured });
|
||||
Ok((remaining, ret))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user