Skip to content

Commit 04287c0

Browse files
committed
Add docs
1 parent d792ea6 commit 04287c0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/nodes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ pub enum NodeValue {
226226
/// Enabled with the `alerts` option.
227227
Alert(Box<NodeAlert>),
228228

229-
///
229+
/// **Block**. Block scoped subscript that acts similar to a header.
230+
/// Enabled with `subtext` option.
230231
Subtext,
231232
}
232233

src/parser/options.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,20 @@ pub struct Extension<'c> {
510510
#[cfg_attr(feature = "bon", builder(default))]
511511
pub cjk_friendly_emphasis: bool,
512512

513+
/// Enables block scoped subscript that acts similar to a header.
513514
///
515+
/// ```md
516+
/// -# subtext
517+
/// ```
518+
///
519+
/// ```rust
520+
/// # use comrak::{markdown_to_html, Options};
521+
/// let mut options = Options::default();
522+
/// options.extension.subscript = true;
523+
///
524+
/// assert_eq!(markdown_to_html("-# subtext", &options),
525+
/// "<p><sub>subtext</sub></p>\n");
526+
/// ```
514527
pub subtext: bool,
515528
}
516529

0 commit comments

Comments
 (0)