Skip to content

Commit aa64f45

Browse files
committed
Handle Markdown paragraphs
1 parent 2763e33 commit aa64f45

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/bors/command/parser.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn extract_text_from_markdown(text: &str) -> String {
7474
cleaned_text.push_str(&text);
7575
}
7676
}
77-
Event::SoftBreak | Event::HardBreak => {
77+
Event::SoftBreak | Event::HardBreak | Event::End(TagEnd::Paragraph) => {
7878
cleaned_text.push('\n');
7979
}
8080
Event::Start(tag) => match tag {
@@ -1091,6 +1091,24 @@ line two
10911091
"###);
10921092
}
10931093

1094+
#[test]
1095+
fn parse_try_md_paragraph() {
1096+
let cmds = parse_commands(
1097+
"@bors try
1098+
1099+
for the crater",
1100+
);
1101+
assert_eq!(cmds.len(), 1);
1102+
insta::assert_debug_snapshot!(cmds[0], @r"
1103+
Ok(
1104+
Try {
1105+
parent: None,
1106+
jobs: [],
1107+
},
1108+
)
1109+
");
1110+
}
1111+
10941112
#[test]
10951113
fn parse_try_unknown_arg() {
10961114
let cmds = parse_commands("@bors try a");

0 commit comments

Comments
 (0)