- HTML parser error with single closing square bracket in table row #1893
- reference counted strings put the HTML bit in the middle of the reference
count #1984
+- & escape disappearing #797
## [2.47.0] - 2021-03-15
return atoi(p);
}
-/* return true if *s points to &[A-Za-z]*; (e.g. Ç )
+/* return true if *s points to &[A-Za-z]+; (e.g. Ç )
* or &#[0-9]*; (e.g. & )
* or &#x[0-9a-fA-F]*; (e.g. 水 )
*/
static int xml_isentity(char *s)
{
s++; /* already known to be '&' */
+ if (*s == ';') { // '&;' is not a valid entity
+ return 0;
+ }
if (*s == '#') {
s++;
if (*s == 'x' || *s == 'X') {
return 1;
}
-/* return true if *s points to &[A-Za-z]*; (e.g. Ç )
+/* return true if *s points to &[A-Za-z]+; (e.g. Ç )
* or &#[0-9]*; (e.g. & )
* or &#x[0-9a-fA-F]*; (e.g. 水 )
*/
static int xml_isentity(char *s)
{
s++; /* already known to be '&' */
+ if (*s == ';') { // '&;' is not a valid entity
+ return 0;
+ }
if (*s == '#') {
s++;
if (*s == 'x' || *s == 'X') {
return strdup_and_subst_obj0 (str, obj, 1);
}
-/* return true if *s points to &[A-Za-z]*; (e.g. Ç )
+/* return true if *s points to &[A-Za-z]+; (e.g. Ç )
* or &#[0-9]*; (e.g. & )
* or &#x[0-9a-fA-F]*; (e.g. 水 )
*/
static int xml_isentity(char *s)
{
s++; /* already known to be '&' */
+ if (*s == ';') { // '&;' is not a valid entity
+ return 0;
+ }
if (*s == '#') {
s++;
if (*s == 'x' || *s == 'X') {
static int xml_isentity(char *s)
{
s++; /* already known to be '&' */
+ if (*s == ';') { // '&;' is not a valid entity
+ return 0;
+ }
if (*s == '#') {
s++;
if (*s == 'x' || *s == 'X') {
# Graphviz should not have caused a segfault
assert p.returncode != -signal.SIGSEGV, 'Graphviz segfaulted'
-@pytest.mark.xfail(strict=True)
def test_797():
'''
“&;” should not be considered an XML escape sequence