Skip to content

Commit b360e5c

Browse files
committed
fix nl2br
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
1 parent 1ea87cd commit b360e5c

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func showComments(s []string) string {
229229
}
230230

231231
func nl2br(s string) string {
232-
return strings.Replace(s, "\n", string(template.HTML("<br/>")), -1)
232+
return strings.Replace(s, "\n\n", string(template.HTML("<br/><br/>")), -1)
233233
}
234234
func safe(s string) template.HTML { return template.HTML(s) }
235235

template/members.tpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@
2828

2929
{{ safe (nl2br (showComments .CommentLines)) }}
3030

31-
{{ if eq (.Type.Name.Name) "ObjectMeta" }}
32-
<p><em>
33-
(Refer to the Kubernetes API documentation for the fields of the
34-
<code>metadata</code> field.)
35-
</em></p>
31+
{{ if and (eq (.Type.Name.Name) "ObjectMeta") }}
32+
Refer to the Kubernetes API documentation for the fields of the
33+
<code>metadata</code> field.
3634
{{ end }}
3735

3836
{{ if or (eq (fieldName .) "spec") }}

0 commit comments

Comments
 (0)