Commits

Walter Dörwald committed 8c437e3

Always handle standard entities as text.

Comments (0)

Files changed (1)

src/ll/xist/sgmlop.c

         } else if (token == ENTITYREF) {
             CHAR_T ch;
             int charref;
-  entity:
-            if (self->handle_entityref) {
-                PyObject* res;
-                if (self->check && !self->check->entityref(self->check, b, e))
-                    return -1;
-                res = PyObject_CallFunction(
-                    self->handle_entityref, BUILDFORMAT, b, e-b
-                    );
-                if (!res)
-                    return -1;
-                Py_DECREF(res);
-                goto next;
-            }
             /* check for standard entity */
             charref = entity(b, e);
             if (charref > 0) {
                     goto next;
                 }
             }
+  entity:
+            if (self->handle_entityref) {
+                PyObject* res;
+                if (self->check && !self->check->entityref(self->check, b, e))
+                    return -1;
+                res = PyObject_CallFunction(
+                    self->handle_entityref, BUILDFORMAT, b, e-b
+                    );
+                if (!res)
+                    return -1;
+                Py_DECREF(res);
+                goto next;
+            }
             if (self->handle_data && self->strict) {
                 /* if the user wants data, but we cannot resolve this
                    entity, flag it as configuration error */