@@ -3,16 +3,17 @@ package handlers
3
3
import (
4
4
"encoding/xml"
5
5
"fmt"
6
- "github.com/getfider/fider/app/models/entity"
7
- "github.com/getfider/fider/app/pkg/env"
8
- "github.com/getfider/fider/app/pkg/i18n"
9
- "github.com/getfider/fider/app/pkg/markdown"
10
6
"html"
11
7
"net/http"
12
8
"strconv"
13
9
"strings"
14
10
"time"
15
11
12
+ "github.com/getfider/fider/app/models/entity"
13
+ "github.com/getfider/fider/app/pkg/env"
14
+ "github.com/getfider/fider/app/pkg/i18n"
15
+ "github.com/getfider/fider/app/pkg/markdown"
16
+
16
17
"github.com/getfider/fider/app/models/query"
17
18
"github.com/getfider/fider/app/pkg/bus"
18
19
"github.com/getfider/fider/app/pkg/web"
@@ -119,7 +120,7 @@ func generatePostContent(c *web.Context, post *entity.Post, options *generatorOp
119
120
})
120
121
}
121
122
122
- return string (markdown .Full (title + post .Description + footer ))
123
+ return string (markdown .Full (title + post .Description + footer , true ))
123
124
}
124
125
125
126
func appendTags (c * web.Context , categories []* Category , post * entity.Post ) ([]* Category , error ) {
@@ -158,7 +159,7 @@ func GlobalFeed() web.HandlerFunc {
158
159
159
160
feed := & AtomFeed {
160
161
Title : c .Tenant ().Name ,
161
- Subtitle : Content {Body : string (markdown .Full (c .Tenant ().WelcomeMessage )), Type : "html" },
162
+ Subtitle : Content {Body : string (markdown .Full (c .Tenant ().WelcomeMessage , true )), Type : "html" },
162
163
Id : web .BaseURL (c ),
163
164
Link : []Link {
164
165
{Href : fmt .Sprintf ("%s/feed/global.atom" , web .BaseURL (c )), Type : "application/atom+xml" , Rel : "self" },
@@ -246,7 +247,7 @@ func CommentFeed() web.HandlerFunc {
246
247
247
248
feed := & AtomFeed {
248
249
Title : post .Title ,
249
- Subtitle : Content {Body : string (markdown .Full (post .Description )), Type : "html" },
250
+ Subtitle : Content {Body : string (markdown .Full (post .Description , true )), Type : "html" },
250
251
Author : & Author {Name : post .User .Name },
251
252
Id : fmt .Sprintf ("%s/posts/%d/#comments" , web .BaseURL (c ), post .Number ),
252
253
Link : []Link {
@@ -288,7 +289,7 @@ func CommentFeed() web.HandlerFunc {
288
289
Link : []Link {
289
290
{Href : fmt .Sprintf ("%s/posts/%d" , web .BaseURL (c ), post .Number ), Type : "text/html" , Rel : "alternate" },
290
291
},
291
- Content : & Content {Type : "html" , Body : string (markdown .Full (post .Response .Text ))},
292
+ Content : & Content {Type : "html" , Body : string (markdown .Full (post .Response .Text , true ))},
292
293
Categories : []* Category {{Term : i18n .T (c , "enum.poststatus." + post .Status .Name ())}},
293
294
})
294
295
}
@@ -314,7 +315,7 @@ func CommentFeed() web.HandlerFunc {
314
315
}
315
316
return formatTime (* comment .EditedAt )
316
317
}(),
317
- Content : & Content {Type : "html" , Body : string (markdown .Full (html .UnescapeString (comment .Content )))},
318
+ Content : & Content {Type : "html" , Body : string (markdown .Full (html .UnescapeString (comment .Content ), true ))},
318
319
Id : fmt .Sprintf ("%s/posts/%d/#comment-%d" , web .BaseURL (c ), post .Number , comment .ID ),
319
320
Link : []Link {{Href : fmt .Sprintf ("%s/posts/%d/#comment-%d" , web .BaseURL (c ), post .Number , comment .ID ), Type : "text/html" , Rel : "alternate" }},
320
321
})
0 commit comments