diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -301,6 +301,13 @@ pub struct Constructs { /// ^^^ /// ``` pub math_text: bool, + /// MDX: JSX (text). + /// + /// ```markdown + /// > | a <Component /> c + /// ^^^^^^^^^^^^^ + /// ``` + pub mdx_jsx_text: bool, /// Thematic break. /// /// ```markdown @@ -342,6 +349,7 @@ impl Default for Constructs { list_item: true, math_flow: false, math_text: false, + mdx_jsx_text: false, thematic_break: true, } } @@ -350,6 +358,8 @@ impl Default for Constructs { impl Constructs { /// GFM. /// + /// <https://github.github.com/gfm/> + /// /// This turns on `CommonMark` + GFM. #[must_use] pub fn gfm() -> Self { @@ -363,6 +373,25 @@ impl Constructs { ..Self::default() } } + + /// MDX. + /// + /// <https://mdxjs.com> + /// + /// This turns on `CommonMark`, turns off some conflicting constructs + /// (autolinks, code (indented), html), and turns on MDX (JSX, + /// expressions, ESM). + #[must_use] + pub fn mdx() -> Self { + Self { + autolink: false, + code_indented: false, + html_flow: false, + html_text: false, + mdx_jsx_text: true, + ..Self::default() + } + } } /// Configuration (optional). |