aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/paragraph.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-20 18:14:15 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-20 18:14:15 +0200
commitc7a46d3cc22bd0b029ff97623cee31c6ec38fdfb (patch)
treecc8991179de6efc57fbefdcd5fbebaeb872e878e /src/construct/paragraph.rs
parent65dd765cceee8bdccc74c08066eec59a579a16b1 (diff)
downloadmarkdown-rs-c7a46d3cc22bd0b029ff97623cee31c6ec38fdfb.tar.gz
markdown-rs-c7a46d3cc22bd0b029ff97623cee31c6ec38fdfb.tar.bz2
markdown-rs-c7a46d3cc22bd0b029ff97623cee31c6ec38fdfb.zip
Add support for line endings in string
Diffstat (limited to 'src/construct/paragraph.rs')
-rw-r--r--src/construct/paragraph.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/construct/paragraph.rs b/src/construct/paragraph.rs
index fa18f28..b00188d 100644
--- a/src/construct/paragraph.rs
+++ b/src/construct/paragraph.rs
@@ -35,6 +35,7 @@ use crate::construct::{
partial_space_or_tab::space_or_tab_min_max, thematic_break::start as thematic_break,
};
use crate::tokenizer::{Code, State, StateFnResult, TokenType, Tokenizer};
+use crate::util::link::link;
/// Before a paragraph.
///
@@ -83,9 +84,8 @@ fn at_line_ending(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
tokenizer.consume(code);
tokenizer.exit(TokenType::ChunkText);
tokenizer.enter(TokenType::ChunkText);
- let next_index = tokenizer.events.len() - 1;
- tokenizer.events[next_index - 2].next = Some(next_index);
- tokenizer.events[next_index].previous = Some(next_index - 2);
+ let index = tokenizer.events.len() - 1;
+ link(&mut tokenizer.events, index);
(State::Fn(Box::new(inside)), None)
}