#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Constructs {
pub autolink: bool,
pub code_indented: bool,
pub html_flow: bool,
pub html_text: bool,
pub gfm_autolink_literal: bool,
pub gfm_footnote: bool,
pub gfm_strikethrough: bool,
pub gfm_strikethrough_single_tilde: bool,
pub gfm_table: bool,
pub gfm_task_list_item: bool,
pub math_flow: bool,
pub math_text: bool,
pub math_text_single_dollar: bool,
pub liquid: bool,
pub wiki_link: bool,
pub container_directive: bool,
pub mdx_esm: bool,
pub mdx_expression_flow: bool,
pub mdx_expression_text: bool,
pub mdx_jsx_flow: bool,
pub mdx_jsx_text: bool,
}
impl Constructs {
pub fn markdown() -> Self {
Self {
autolink: true,
code_indented: true,
html_flow: true,
html_text: true,
gfm_autolink_literal: true,
gfm_footnote: true,
gfm_strikethrough: true,
gfm_strikethrough_single_tilde: false,
gfm_table: true,
gfm_task_list_item: true,
math_flow: true,
math_text: true,
math_text_single_dollar: false,
liquid: true,
wiki_link: true,
container_directive: true,
mdx_esm: false,
mdx_expression_flow: false,
mdx_expression_text: false,
mdx_jsx_flow: false,
mdx_jsx_text: false,
}
}
pub fn mdx() -> Self {
Self {
autolink: false,
code_indented: false,
html_flow: false,
html_text: false,
mdx_esm: true,
mdx_expression_flow: true,
mdx_expression_text: true,
mdx_jsx_flow: true,
mdx_jsx_text: true,
..Self::markdown()
}
}
}
impl Default for Constructs {
fn default() -> Self {
Self::markdown()
}
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub struct ParserOptions {
pub constructs: Constructs,
}
impl ParserOptions {
pub fn markdown() -> Self {
Self { constructs: Constructs::markdown() }
}
pub fn mdx() -> Self {
Self { constructs: Constructs::mdx() }
}
}