Chromium Code Reviews| Index: milo/appengine/buildbot/build.go |
| diff --git a/milo/appengine/buildbot/build.go b/milo/appengine/buildbot/build.go |
| index 153b7c9e2cc60ac5ccc7a5e59aa80069b3e3c6b5..86c1e4377500810a7fa674a967428f97f9b25a47 100644 |
| --- a/milo/appengine/buildbot/build.go |
| +++ b/milo/appengine/buildbot/build.go |
| @@ -10,6 +10,7 @@ import ( |
| "io/ioutil" |
| "net/http" |
| "path/filepath" |
| + "regexp" |
| "sort" |
| "strings" |
| "time" |
| @@ -174,6 +175,8 @@ func summary(c context.Context, b *buildbotBuild) resp.BuildComponent { |
| return sum |
| } |
| +var rLineBreak = regexp.MustCompile("<br */*>") |
|
estaab
2016/12/28 00:57:13
use "<br */?>" since only zero or one slash is exp
hinoka
2016/12/28 19:29:44
Done.
|
| + |
| // components takes a full buildbot build struct and extract step info from all |
| // of the steps and returns it as a list of milo Build Components. |
| func components(b *buildbotBuild) (result []*resp.BuildComponent) { |
| @@ -183,7 +186,12 @@ func components(b *buildbotBuild) (result []*resp.BuildComponent) { |
| } |
| bc := &resp.BuildComponent{ |
| Label: step.Name, |
| - Text: step.Text, |
| + } |
| + // Step text sometimes contains <br>, which we want to parse into new lines. |
| + for _, t := range step.Text { |
| + for _, line := range rLineBreak.Split(t, -1) { |
| + bc.Text = append(bc.Text, line) |
| + } |
| } |
| // Figure out the status. |