aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/heading_atx.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 13:27:16 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 13:27:16 +0200
commitc9f75249b83839130ffbc3b6dd175b0e31008cb7 (patch)
tree55012a12979e5960845a611162a9a3e340627fa5 /src/construct/heading_atx.rs
parent2100b41ee330ef6b088b4d7efdf8ea589a650ceb (diff)
downloadmarkdown-rs-c9f75249b83839130ffbc3b6dd175b0e31008cb7.tar.gz
markdown-rs-c9f75249b83839130ffbc3b6dd175b0e31008cb7.tar.bz2
markdown-rs-c9f75249b83839130ffbc3b6dd175b0e31008cb7.zip
Refactor examples of states
Diffstat (limited to '')
-rw-r--r--src/construct/heading_atx.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/construct/heading_atx.rs b/src/construct/heading_atx.rs
index 4a4992a..8947f64 100644
--- a/src/construct/heading_atx.rs
+++ b/src/construct/heading_atx.rs
@@ -63,7 +63,8 @@ use crate::util::edit_map::EditMap;
/// Start of a heading (atx).
///
/// ```markdown
-/// |## alpha
+/// > | ## aa
+/// ^
/// ```
pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
tokenizer.enter(Token::HeadingAtx);
@@ -74,7 +75,8 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
/// Start of a heading (atx), after whitespace.
///
/// ```markdown
-/// |## alpha
+/// > | ## aa
+/// ^
/// ```
fn before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
if Code::Char('#') == code {
@@ -88,7 +90,8 @@ fn before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
/// In the opening sequence.
///
/// ```markdown
-/// #|# alpha
+/// > | ## aa
+/// ^
/// ```
fn sequence_open(tokenizer: &mut Tokenizer, code: Code, rank: usize) -> StateFnResult {
match code {
@@ -116,11 +119,8 @@ fn sequence_open(tokenizer: &mut Tokenizer, code: Code, rank: usize) -> StateFnR
/// After something but before something else.
///
/// ```markdown
-/// ## |alpha
-/// ## alpha| bravo
-/// ## alpha |bravo
-/// ## alpha bravo|##
-/// ## alpha bravo ##|
+/// > | ## aa
+/// ^
/// ```
fn at_break(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
match code {
@@ -146,10 +146,12 @@ fn at_break(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
}
/// In a further sequence (after whitespace).
+///
/// Could be normal “visible” hashes in the heading or a final sequence.
///
/// ```markdown
-/// ## alpha #|#
+/// > | ## aa ##
+/// ^
/// ```
fn further_sequence(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
if let Code::Char('#') = code {
@@ -164,7 +166,8 @@ fn further_sequence(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
/// In text.
///
/// ```markdown
-/// ## al|pha
+/// > | ## aa
+/// ^
/// ```
fn data(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
match code {