Only use the encoding attribute for MathML annotation-xml elements
Extremely minor optimization. The encoding attribute only matters
when parsing fragments with a context element that is a MathML
annotation-xml.
@@ -501,7 +501,8 @@ error:
}
// Encoding.
- if (RSTRING_LEN(tag_name) == 14
+ if (ctx_ns == GUMBO_NAMESPACE_MATHML
+ && RSTRING_LEN(tag_name) == 14
&& !st_strcasecmp(ctx_tag, "annotation-xml")) {
VALUE enc = rb_funcall(ctx, rb_intern_const("[]"),
1,
