Re: [xml] HTMLtree.c escapes braces

2015-10-16 Thread Daniel Veillard
On Thu, Sep 24, 2015 at 10:12:25PM +, Bruce Sinclair wrote:
> Hi Daniel,
> 
> We have had the issue that libxml2 encodes curly braces as character 
> references in HTML output because of the following code in HTMLtree.c:
> 
>escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
>if (escaped != NULL) {
> xmlBufferWriteQuotedString(buf->buffer, escaped);
> xmlFree(escaped);
> } else {
> xmlBufferWriteQuotedString(buf->buffer, value);
> }
> 
> We don't think the curly braces, "{" and "}", should be changed to character 
> references.  Doing so causes a problem with the use of braces in a Server 
> Response File (SRF) generated with libxml2.  We change the first line of the 
> above code to:
> 
>escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+{}");
> 
> to eliminate this issue.  Could this be accepted as a fix to libxml2?
> 

  Hi Bruce,

  I don't understand, that code is in attribute content escaping, and
for me "{" and "}" are not escaped:

thinkpad2:~/XML -> cat ./tst.html





thinkpad2:~/XML -> ./xmllint --html ./tst.html
http://www.w3.org/TR/REC-html40/loose.dtd;>





thinkpad2:~/XML -> 

Please provide a reproducer with xmllint so I understand what is going on,

  thanks,

Daniel

-- 
Daniel Veillard  | Open Source and Standards, Red Hat
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


[xml] HTMLtree.c escapes braces

2015-09-24 Thread Bruce Sinclair
Hi Daniel,

We have had the issue that libxml2 encodes curly braces as character references 
in HTML output because of the following code in HTMLtree.c:

   escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
   if (escaped != NULL) {
xmlBufferWriteQuotedString(buf->buffer, escaped);
xmlFree(escaped);
} else {
xmlBufferWriteQuotedString(buf->buffer, value);
}

We don't think the curly braces, "{" and "}", should be changed to character 
references.  Doing so causes a problem with the use of braces in a Server 
Response File (SRF) generated with libxml2.  We change the first line of the 
above code to:

   escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+{}");

to eliminate this issue.  Could this be accepted as a fix to libxml2?


Bruce Sinclair
Software Systems Developer - Senior Principal

Micro Focus

bruce.sincl...@microfocus.com
8310 N. Capital of Texas Hwy.
Building 1, Suite 155
Austin, Texas  78731-1002
Direct: +1 512 340 4717
Shoretel 27023


Please consider the environment before printing this e-mail.
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml