[PATCH 12 of 20] hgweb, paper: add shortlogajax template and use it

Martin Geisler martin at geisler.net
Tue Aug 13 03:30:19 CDT 2013


Alexander Plavin <alexander at plav.in> writes:

> [...] the rendered, complete html code is sent as a CDATA section, and
> js just has to add it to the page.

Please ignore this if it's obvious to you, but remember that you need to
escape "]]>" in CDATA sections:

  http://en.wikipedia.org/wiki/CDATA#Uses_of_CDATA_sections

You will probably have to unescape this again on the client side?

In other words, using CDATA isn't really different from using normal
escaping of "<" and "&", it just feels that way because you (typically)
get to escape fewer characters.


Another thought that occured to me when I read the discussion about
writing an XML style: have you considered writing a JSON style instead?
That might be even more useful for JavaScript code.

Other applications might benefit from such a style too, even on the
command line where I would prefer to parse JSON encoded 'hg log' output
over XML output. That of course depends on whether JSON or XML has
better support in the environment where you work.

-- 
Martin Geisler


More information about the Mercurial-devel mailing list