[PATCH] issue1714: atom: xmlescape

Brodie Rao dackze at gmail.com
Sun Jun 28 13:46:53 CDT 2009


On Jun 28, 2009, at 10:36 AM, Nicolas Dumazet wrote:

> # HG changeset patch
> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> # Date 1246198718 -32400
> # Node ID d27134fb1119410f51fee4e7aa89c3a9008036aa
> # Parent  835a51e63c5b0e4eee4f95fcbbdaf4476629a621
> atom: Use xmlescape instead of escape (issue1714)

So you think interhg should be disabled for atom feeds? What if the  
user isn't inserting HTML, but is instead inserting something that's  
valid for both feeds and HTML?

Also, what about RSS feeds? This issue affects them in much the same  
manner.

If a change like this is made, it needs to be documented in at least  
interhg as well.

> diff --git a/templates/atom/changelogentry.tmpl b/templates/atom/ 
> changelogentry.tmpl
> --- a/templates/atom/changelogentry.tmpl
> +++ b/templates/atom/changelogentry.tmpl
> @@ -1,16 +1,16 @@
>  <entry>
> -  <title>{desc|strip|firstline|strip|escape|nonempty}</title>
> +  <title>{desc|strip|firstline|strip|xmlescape|nonempty}</title>
>   <id>{urlbase}{url}#changeset-{node}</id>
>   <link href="{urlbase}{url}rev/{node}"/>
>   <author>
> -   <name>{author|person|escape}</name>
> +   <name>{author|person|xmlescape}</name>
>    <email>{author|email|obfuscate}</email>
>   </author>
>   <updated>{date|rfc3339date}</updated>
>   <published>{date|rfc3339date}</published>
>   <content type="xhtml">
>    <div xmlns="http://www.w3.org/1999/xhtml">
> -    <pre xml:space="preserve">{desc|escape|nonempty}</pre>
> +    <pre xml:space="preserve">{desc|xmlescape|nonempty}</pre>

The description one area where it would make sense to insert HTML  
through interhg.

I believe the RSS feed includes the description as CDATA, so just  
using escape as it does now should suffice.


More information about the Mercurial-devel mailing list