aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/heading_atx.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-15 19:20:43 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-15 19:20:43 +0200
commitb150a72975d6e75b96298b3d405afe070271d78b (patch)
tree8f6bd8f1f527f432715f20b2b8d9d2a272224905 /src/construct/heading_atx.rs
parentacc35758778bfda5cb01951533868eb8baa2e2d2 (diff)
downloadmarkdown-rs-b150a72975d6e75b96298b3d405afe070271d78b.tar.gz
markdown-rs-b150a72975d6e75b96298b3d405afe070271d78b.tar.bz2
markdown-rs-b150a72975d6e75b96298b3d405afe070271d78b.zip
Add support for text in heading (atx)
Diffstat (limited to 'src/construct/heading_atx.rs')
-rw-r--r--src/construct/heading_atx.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/construct/heading_atx.rs b/src/construct/heading_atx.rs
index 3be8c99..1a9ed03 100644
--- a/src/construct/heading_atx.rs
+++ b/src/construct/heading_atx.rs
@@ -117,6 +117,7 @@ fn at_break(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
}
Code::Char(_) => {
tokenizer.enter(TokenType::AtxHeadingText);
+ tokenizer.enter(TokenType::ChunkText);
data(tokenizer, code)
}
}
@@ -165,6 +166,7 @@ fn data(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
match code {
// Note: `#` for closing sequence must be preceded by whitespace, otherwise it’s just text.
Code::None | Code::CarriageReturnLineFeed | Code::Char('\t' | '\n' | '\r' | ' ') => {
+ tokenizer.exit(TokenType::ChunkText);
tokenizer.exit(TokenType::AtxHeadingText);
at_break(tokenizer, code)
}