aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 00f1c5c..ba257db 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -166,6 +166,13 @@ pub struct Constructs {
/// ^^^
/// ````
pub frontmatter: bool,
+ /// GFM: autolink literal.
+ ///
+ /// ```markdown
+ /// > | https://example.com
+ /// ^^^^^^^^^^^^^^^^^^^
+ /// ```
+ pub gfm_autolink_literal: bool,
/// Hard break (escape).
///
/// ```markdown
@@ -263,6 +270,7 @@ impl Default for Constructs {
code_text: true,
definition: true,
frontmatter: false,
+ gfm_autolink_literal: false,
hard_break_escape: true,
hard_break_trailing: true,
heading_atx: true,
@@ -278,6 +286,19 @@ impl Default for Constructs {
}
}
+impl Constructs {
+ /// GFM.
+ ///
+ /// This turns on `CommonMark` + GFM.
+ #[must_use]
+ pub fn gfm() -> Self {
+ Self {
+ gfm_autolink_literal: true,
+ ..Self::default()
+ }
+ }
+}
+
/// Configuration (optional).
#[derive(Clone, Debug, Default)]
pub struct Options {