rust-lang / rustc-perf

Website for graphing performance of rustc

Home Page:https://perf.rust-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Perf builds for each rolled up PR" table gets confused by pipe `|` characters in description

Zalathar opened this issue · comments

See rust-lang/rust#121859 (comment) for an example.

The bot tried to render the rolled-up perf builds in a table, but the line for rust-lang/rust#121784 abruptly cuts off mid-description, because the issue description contains pipe characters (||).

Presumably they aren't being escaped by the bot, so the GitHub table renderer treats them as cell boundaries instead of visible pipe characters.

I imagine some backslash-escaping for pipe characters is needed here:

let message = c
.rollup_merge
.message
.split('\n')
// Skip over "Rollup merge of ..." and an empty line
.nth(2)
.map(|m| {
if m.len() <= 60 {
m.to_string()
} else {
format!("{}…", m.split_at(59).0)
}
})
.unwrap_or_else(|| format!("#{}", c.original_pr_number));
writeln!(
&mut string,
"|#{pr}|{message}|{commit}|",
pr = c.original_pr_number
)

Ah, good point, we should probably escape Markdown there.

Do you want to try to fix this? :)