aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-07 11:37:12 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-07 11:37:12 +0200
commit71781c2a05ba7da04d0666db17dc85e23e9c1252 (patch)
tree1ad63628bcac407803f622d70be38cbadea40818
parenta4436b91eabf3911ab59ac3f6be9de877b4f415a (diff)
downloadmarkdown-rs-71781c2a05ba7da04d0666db17dc85e23e9c1252.tar.gz
markdown-rs-71781c2a05ba7da04d0666db17dc85e23e9c1252.tar.bz2
markdown-rs-71781c2a05ba7da04d0666db17dc85e23e9c1252.zip
Add support for `Flow` content type
Diffstat (limited to '')
-rw-r--r--src/subtokenize.rs6
-rw-r--r--src/tokenizer.rs2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs
index 6b0460c..dd0351d 100644
--- a/src/subtokenize.rs
+++ b/src/subtokenize.rs
@@ -21,7 +21,7 @@
//! thus the whole document needs to be parsed up to the level of definitions,
//! before any level that can include references can be parsed.
-use crate::content::{string::start as string, text::start as text};
+use crate::content::{flow::start as flow, string::start as string, text::start as text};
use crate::parser::ParseState;
use crate::tokenizer::{ContentType, Event, EventType, State, StateFn, StateFnResult, Tokenizer};
use crate::util::span;
@@ -90,7 +90,9 @@ pub fn subtokenize(mut events: Vec<Event>, parse_state: &ParseState) -> (Vec<Eve
let mut tokenizer = Tokenizer::new(event.point.clone(), event.index, parse_state);
// Substate.
let mut result: StateFnResult = (
- State::Fn(Box::new(if *content_type == ContentType::String {
+ State::Fn(Box::new(if *content_type == ContentType::Flow {
+ flow
+ } else if *content_type == ContentType::String {
string
} else {
text
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 8c8cf58..8c11a68 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -1707,6 +1707,8 @@ pub enum TokenType {
/// Embedded content type.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ContentType {
+ /// Represents [flow content][crate::content::flow].
+ Flow,
/// Represents [text content][crate::content::text].
Text,
/// Represents [string content][crate::content::string].