aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-29 17:15:17 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-29 17:15:17 +0200
commita056a7b3716bd4cc78e47e64f7d735c5bd5b82e6 (patch)
tree18395a3438441f5ddeca984fab0db8c9f8133a2c /src/construct
parentfa37356074c1bc3a0f74b6f6a22e038b7842ff4d (diff)
downloadmarkdown-rs-a056a7b3716bd4cc78e47e64f7d735c5bd5b82e6.tar.gz
markdown-rs-a056a7b3716bd4cc78e47e64f7d735c5bd5b82e6.tar.bz2
markdown-rs-a056a7b3716bd4cc78e47e64f7d735c5bd5b82e6.zip
Fix a bunch of bugs with definitions, references
* Fix bug where whitespace after `:` was not allowed, it is * Fix bug where escapes in labels did not work due to typo * Fix to prefer first definition * Fix whitespace after definitions * Fix matching by adding normalizing * Fix reference from being output as data
Diffstat (limited to 'src/construct')
-rw-r--r--src/construct/definition.rs2
-rw-r--r--src/construct/partial_label.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/construct/definition.rs b/src/construct/definition.rs
index 5e80a93..aca22a6 100644
--- a/src/construct/definition.rs
+++ b/src/construct/definition.rs
@@ -149,7 +149,7 @@ fn label_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
tokenizer.exit(TokenType::DefinitionMarker);
(
State::Fn(Box::new(
- tokenizer.go(space_or_tab_one_line_ending(), destination_before),
+ tokenizer.attempt_opt(space_or_tab_one_line_ending(), destination_before),
)),
None,
)
diff --git a/src/construct/partial_label.rs b/src/construct/partial_label.rs
index 2e8e950..1e4d7f2 100644
--- a/src/construct/partial_label.rs
+++ b/src/construct/partial_label.rs
@@ -181,7 +181,7 @@ fn label(tokenizer: &mut Tokenizer, code: Code, mut info: Info) -> StateFnResult
info.size += 1;
(State::Fn(Box::new(|t, c| label(t, c, info))), None)
}
- Code::Char('/') => {
+ Code::Char('\\') => {
tokenizer.consume(code);
info.size += 1;
if !info.data {