aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-07 17:51:38 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-07 17:51:38 +0200
commit0e58191dd7cdbdc632866c8315117ccc68103aad (patch)
treecf076c91ce990060f4e8e782e8ca233fe7711208
parenta953ccac20ad9e10c87f7a37228858762edc39b6 (diff)
downloadmarkdown-rs-0e58191dd7cdbdc632866c8315117ccc68103aad.tar.gz
markdown-rs-0e58191dd7cdbdc632866c8315117ccc68103aad.tar.bz2
markdown-rs-0e58191dd7cdbdc632866c8315117ccc68103aad.zip
Fix order of tokens
Diffstat (limited to '')
-rw-r--r--src/tokenizer.rs154
1 files changed, 77 insertions, 77 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index cbcc464..069134a 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -17,6 +17,10 @@ use std::collections::HashMap;
/// Semantic label of a span.
#[derive(Debug, Clone, PartialEq, Hash, Eq)]
pub enum TokenType {
+ /// Attention sequence.
+ ///
+ /// > 👉 **Note**: this is used while parsing but compiled away.
+ AttentionSequence,
/// Whole autolink.
///
/// ## Info
@@ -109,6 +113,10 @@ pub enum TokenType {
/// ^
/// ```
BlankLineEnding,
+ BlockQuote,
+ BlockQuoteMarker,
+ BlockQuotePrefix,
+ BlockQuotePrefixWhitespace,
/// Whole character escape.
///
/// ## Info
@@ -781,6 +789,61 @@ pub enum TokenType {
/// ^
/// ```
DefinitionTitleString,
+ /// Emphasis.
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [text content][crate::content::text]
+ /// * **Content model**:
+ /// [`EmphasisSequence`][TokenType::EmphasisSequence],
+ /// [`EmphasisText`][TokenType::EmphasisText]
+ /// * **Construct**:
+ /// [`attention`][crate::construct::attention]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | *a*
+ /// ^^^
+ /// ```
+ Emphasis,
+ /// Emphasis sequence.
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [`Emphasis`][TokenType::Emphasis]
+ /// * **Content model**:
+ /// void
+ /// * **Construct**:
+ /// [`attention`][crate::construct::attention]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | *a*
+ /// ^ ^
+ /// ```
+ EmphasisSequence,
+ /// Emphasis text.
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [`Emphasis`][TokenType::Emphasis]
+ /// * **Content model**:
+ /// [text content][crate::content::text]
+ /// * **Construct**:
+ /// [`attention`][crate::construct::attention]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | *a*
+ /// ^
+ /// ```
+ EmphasisText,
/// Whole hard break (escape).
///
/// ## Info
@@ -1551,43 +1614,6 @@ pub enum TokenType {
/// ^ ^ ^ ^
/// ```
SpaceOrTab,
- /// Whole thematic break.
- ///
- /// ## Info
- ///
- /// * **Context**:
- /// [flow content][crate::content::flow]
- /// * **Content model**:
- /// [`ThematicBreakSequence`][TokenType::ThematicBreakSequence],
- /// [`SpaceOrTab`][TokenType::SpaceOrTab]
- /// * **Construct**:
- /// [`thematic_break`][crate::construct::thematic_break]
- ///
- /// ## Example
- ///
- /// ```markdown
- /// > | * * *
- /// ^^^^^
- /// ```
- ThematicBreak,
- /// Thematic break sequence.
- ///
- /// ## Info
- ///
- /// * **Context**:
- /// [`ThematicBreak`][TokenType::ThematicBreak]
- /// * **Content model**:
- /// void
- /// * **Construct**:
- /// [`thematic_break`][crate::construct::thematic_break]
- ///
- /// ## Example
- ///
- /// ```markdown
- /// > | * * *
- /// ^ ^ ^
- /// ```
- ThematicBreakSequence,
/// Strong.
///
/// ## Info
@@ -1643,69 +1669,43 @@ pub enum TokenType {
/// ^
/// ```
StrongText,
- /// Emphasis.
+ /// Whole thematic break.
///
/// ## Info
///
/// * **Context**:
- /// [text content][crate::content::text]
+ /// [flow content][crate::content::flow]
/// * **Content model**:
- /// [`EmphasisSequence`][TokenType::EmphasisSequence],
- /// [`EmphasisText`][TokenType::EmphasisText]
+ /// [`ThematicBreakSequence`][TokenType::ThematicBreakSequence],
+ /// [`SpaceOrTab`][TokenType::SpaceOrTab]
/// * **Construct**:
- /// [`attention`][crate::construct::attention]
+ /// [`thematic_break`][crate::construct::thematic_break]
///
/// ## Example
///
/// ```markdown
- /// > | *a*
- /// ^^^
+ /// > | * * *
+ /// ^^^^^
/// ```
- Emphasis,
- /// Emphasis sequence.
+ ThematicBreak,
+ /// Thematic break sequence.
///
/// ## Info
///
/// * **Context**:
- /// [`Emphasis`][TokenType::Emphasis]
+ /// [`ThematicBreak`][TokenType::ThematicBreak]
/// * **Content model**:
/// void
/// * **Construct**:
- /// [`attention`][crate::construct::attention]
- ///
- /// ## Example
- ///
- /// ```markdown
- /// > | *a*
- /// ^ ^
- /// ```
- EmphasisSequence,
- /// Emphasis text.
- ///
- /// ## Info
- ///
- /// * **Context**:
- /// [`Emphasis`][TokenType::Emphasis]
- /// * **Content model**:
- /// [text content][crate::content::text]
- /// * **Construct**:
- /// [`attention`][crate::construct::attention]
+ /// [`thematic_break`][crate::construct::thematic_break]
///
/// ## Example
///
/// ```markdown
- /// > | *a*
- /// ^
+ /// > | * * *
+ /// ^ ^ ^
/// ```
- EmphasisText,
- /// Attention sequence.
- ///
- /// > 👉 **Note**: this is used while parsing but compiled away.
- AttentionSequence,
- BlockQuote,
- BlockQuoteMarker,
- BlockQuotePrefix,
- BlockQuotePrefixWhitespace,
+ ThematicBreakSequence,
}
/// Embedded content type.