aboutsummaryrefslogtreecommitdiff
path: root/parse_wiki_text/src
diff options
context:
space:
mode:
authorJJ2023-01-16 10:42:00 +0000
committerJJ2023-01-16 10:42:00 +0000
commit0c2a21228bb825c1485a1e143b9f59ea48b541a5 (patch)
treeaec6caa14ff1b388975c2d60eb9a52c3ade35427 /parse_wiki_text/src
parent1c5ae132e1aea028529a3ad2e27ff04a9de602ea (diff)
parse_wiki_text: fix incorrect parsing of pages lacking a leading newline
Diffstat (limited to 'parse_wiki_text/src')
-rw-r--r--parse_wiki_text/src/parse.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse_wiki_text/src/parse.rs b/parse_wiki_text/src/parse.rs
index 33314bb..1849a24 100644
--- a/parse_wiki_text/src/parse.rs
+++ b/parse_wiki_text/src/parse.rs
@@ -106,7 +106,13 @@ pub fn parse<'a>(configuration: &crate::Configuration, wiki_text: &'a str) -> cr
_ => crate::tag::parse_start_tag(&mut state, configuration),
},
Some(b'=') => {
- crate::template::parse_parameter_name_end(&mut state);
+ // hack
+ if state.get_byte(state.scan_position - 1) == Some(b'>') {
+ state.scan_position -= 1;
+ crate::line::parse_end_of_line(&mut state);
+ } else {
+ crate::template::parse_parameter_name_end(&mut state);
+ }
}
Some(b'[') => {
if state.get_byte(state.scan_position + 1) == Some(b'[') {