Create structure for inline source blocks.

This commit is contained in:
Tom Alexander
2023-07-21 22:29:04 -04:00
parent b323a407c4
commit e0d2bb8213
6 changed files with 69 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ use crate::parser::entity::entity;
use crate::parser::export_snippet::export_snippet;
use crate::parser::footnote_reference::footnote_reference;
use crate::parser::inline_babel_call::inline_babel_call;
use crate::parser::inline_source_block::inline_source_block;
use crate::parser::latex_fragment::latex_fragment;
use crate::parser::object::Object;
use crate::parser::org_macro::org_macro;
@@ -26,10 +27,14 @@ pub fn standard_set_object<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
) -> Res<&'s str, Object<'s>> {
// TODO: inline source blocks, line breaks, targets (different from radio targets), statistics cookies, subscript and superscript, timestamps.
// TODO: line breaks, targets (different from radio targets), statistics cookies, subscript and superscript, timestamps.
not(|i| context.check_exit_matcher(i))(input)?;
alt((
map(
parser_with_context!(inline_source_block)(context),
Object::InlineSourceBlock,
),
map(
parser_with_context!(inline_babel_call)(context),
Object::InlineBabelCall,
@@ -91,6 +96,10 @@ pub fn any_object_except_plain_text<'r, 's>(
) -> Res<&'s str, Object<'s>> {
// Used for exit matchers so this does not check exit matcher condition.
alt((
map(
parser_with_context!(inline_source_block)(context),
Object::InlineSourceBlock,
),
map(
parser_with_context!(inline_babel_call)(context),
Object::InlineBabelCall,
@@ -130,8 +139,12 @@ pub fn regular_link_description_object_set<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
) -> Res<&'s str, Object<'s>> {
// TODO: minimal set of objects as well as export snippets, inline source blocks, and statistics cookies. It can also contain another link, but only when it is a plain or angle link. It can contain square brackets, but not ]]
// TODO: minimal set of objects as well as export snippets, and statistics cookies. It can also contain another link, but only when it is a plain or angle link. It can contain square brackets, but not ]]
alt((
map(
parser_with_context!(inline_source_block)(context),
Object::InlineSourceBlock,
),
map(
parser_with_context!(inline_babel_call)(context),
Object::InlineBabelCall,