(refs #811)Remove html tags from title of atom feed

This commit is contained in:
Naoki Takezoe
2015-07-05 22:15:39 +09:00
parent 88f3ee4b13
commit 59e826b630
2 changed files with 6 additions and 1 deletions

View File

@@ -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 '/'.
*/

View File

@@ -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>