5
5
"encoding/json"
6
6
"go/doc"
7
7
"html/template"
8
+ "strings"
8
9
9
10
"github.com/fatih/structtag"
10
11
"github.com/gobuffalo/plush"
@@ -22,7 +23,7 @@ func Render(template string, def parser.Definition, params map[string]interface{
22
23
ctx .Set ("def" , def )
23
24
ctx .Set ("params" , params )
24
25
ctx .Set ("json" , toJSONHelper )
25
- ctx .Set ("format_comment " , formatComment )
26
+ ctx .Set ("format_comment_line " , formatCommentLine )
26
27
ctx .Set ("format_comment_text" , formatCommentText )
27
28
ctx .Set ("format_comment_html" , formatCommentHTML )
28
29
ctx .Set ("format_tags" , formatTags )
@@ -41,10 +42,11 @@ func toJSONHelper(v interface{}) (template.HTML, error) {
41
42
return template .HTML (b ), nil
42
43
}
43
44
44
- func formatComment ( s string , linePrefix string ) template.HTML {
45
+ func formatCommentLine ( s string ) template.HTML {
45
46
var buf bytes.Buffer
46
- doc .ToText (& buf , s , linePrefix , linePrefix , 80 )
47
- return template .HTML (buf .String ())
47
+ doc .ToText (& buf , s , "" , "" , 2000 )
48
+ s = strings .TrimSpace (buf .String ())
49
+ return template .HTML (s )
48
50
}
49
51
50
52
func formatCommentText (s string ) template.HTML {
0 commit comments