mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 16:35:52 +01:00
(refs #811)Remove html tags from title of atom feed
This commit is contained in:
@@ -155,6 +155,11 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
||||
.replaceAll("\\[commit:([^\\s]+?)/([^\\s]+?)\\@([^\\s]+?)\\]", (m: Match) => s"""<a href="${context.path}/${m.group(1)}/${m.group(2)}/commit/${m.group(3)}">${m.group(1)}/${m.group(2)}@${m.group(3).substring(0, 7)}</a>""")
|
||||
)
|
||||
|
||||
/**
|
||||
* Remove html tags from the given Html instance.
|
||||
*/
|
||||
def removeHtml(html: Html): Html = Html(html.body.replaceAll("<.+?>", ""))
|
||||
|
||||
/**
|
||||
* URL encode except '/'.
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<published>@datetimeRFC3339(activity.activityDate)</published>
|
||||
<updated>@datetimeRFC3339(activity.activityDate)</updated>
|
||||
<link type="text/html" rel="alternate" href="@context.baseUrl/@activity.userName/@activity.repositoryName" />
|
||||
<title type="html">@activityMessage(activity.message)</title>
|
||||
<title type="html">@removeHtml(activityMessage(activity.message))</title>
|
||||
<author>
|
||||
<name>@activity.activityUserName</name>
|
||||
<uri>@url(activity.activityUserName)</uri>
|
||||
|
||||
Reference in New Issue
Block a user