diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -164,6 +164,8 @@ class templater: common_filters = { "escape": cgi.escape, + "strip": lambda x: x.strip(), + "rstrip": lambda x: x.rstrip(), "age": age, "date": lambda x: util.datestr(x), "addbreaks": nl2br, diff --git a/templates/changelogentry-rss.tmpl b/templates/changelogentry-rss.tmpl --- a/templates/changelogentry-rss.tmpl +++ b/templates/changelogentry-rss.tmpl @@ -1,7 +1,7 @@ <item> - <title>#desc|firstline|escape#</title> + <title>#desc|strip|firstline|rstrip|escape#</title> <link>#url#?cs=#node|short#</link> - <description><![CDATA[#desc|escape|addbreaks#]]></description> + <description><![CDATA[#desc|strip|escape|addbreaks#]]></description> <author>#author|obfuscate#</author> <pubDate>#date|rfc822date#</pubDate> </item> diff --git a/templates/changelogentry.tmpl b/templates/changelogentry.tmpl --- a/templates/changelogentry.tmpl +++ b/templates/changelogentry.tmpl @@ -1,7 +1,7 @@ <table class="changelogEntry parity#parity#"> <tr> <th class="age" width="15%">#date|age# ago:</th> - <th class="firstline">#desc|firstline|escape#</th> + <th class="firstline">#desc|strip|firstline|escape#</th> </tr> <tr> <th class="changesetRev">changeset #rev#:</th> diff --git a/templates/changeset.tmpl b/templates/changeset.tmpl --- a/templates/changeset.tmpl +++ b/templates/changeset.tmpl @@ -11,7 +11,7 @@ #archives%archiveentry# </div> -<h2>changeset: #desc|escape|firstline#</h2> +<h2>changeset: #desc|strip|escape|firstline#</h2> <table id="changesetEntry"> <tr> @@ -32,7 +32,7 @@ <td class="files">#files#</td></tr> <tr> <th class="description">description:</th> - <td class="description">#desc|escape|addbreaks#</td> + <td class="description">#desc|strip|escape|addbreaks#</td> </tr> </table> diff --git a/templates/filelogentry-rss.tmpl b/templates/filelogentry-rss.tmpl --- a/templates/filelogentry-rss.tmpl +++ b/templates/filelogentry-rss.tmpl @@ -1,7 +1,7 @@ <item> - <title>#desc|firstline|escape#</title> + <title>#desc|strip|firstline|rstrip|escape#</title> <link>#url#?f=#filenode|short#;file=#file#</link> - <description><![CDATA[#desc|escape|addbreaks#]]></description> + <description><![CDATA[#desc|strip|escape|addbreaks#]]></description> <author>#author|obfuscate#</author> <pubDate>#date|rfc822date#</pubDate>> </item> diff --git a/templates/filelogentry.tmpl b/templates/filelogentry.tmpl --- a/templates/filelogentry.tmpl +++ b/templates/filelogentry.tmpl @@ -1,7 +1,7 @@ <table class="parity#parity#" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="right" width="15%"><b>#date|age# ago: </b></td> - <td><b><a href="?cs=#node|short#">#desc|firstline|escape#</a></b></td></tr> + <td><b><a href="?cs=#node|short#">#desc|strip|firstline|escape#</a></b></td></tr> <tr> <td align="right">revision #filerev#: </td> <td><a href="?f=#filenode|short#;file=#file#">#filenode|short#</a>