Fix doc parsing bug

This commit is contained in:
Richard Feldman 2020-05-23 22:43:09 -04:00
parent 715b13263c
commit 1d6d9ec994

View file

@ -285,6 +285,7 @@ fn spaces<'a>(
// If we're in a line comment, this won't affect indentation anyway. // If we're in a line comment, this won't affect indentation anyway.
state = state.advance_without_indenting(1)?; state = state.advance_without_indenting(1)?;
if comment_line_buf.len() == 1 {
match comment_line_buf.chars().next() { match comment_line_buf.chars().next() {
Some('#') => { Some('#') => {
// This is a comment begining with `## ` - that is, // This is a comment begining with `## ` - that is,
@ -302,6 +303,9 @@ fn spaces<'a>(
comment_line_buf.push(ch); comment_line_buf.push(ch);
} }
} }
} else {
comment_line_buf.push(ch);
}
} }
'\n' => { '\n' => {
state = state.newline()?; state = state.newline()?;