If the html loaded by pjax does start with an <html>-tag but does not contain a <head>- or just an empty <head/>-tag, an error is thrown in extractContainer because the regex-match looking for content within <head></head>-tags does not match and returns null instead of an array.
As the HTML-Specification enforces (at least as i understand it) that an <html>-tag always has an <head> and a <body>-tag but <head> may be empty (<title> is optional "when a higher-level protocol provides title information"), it seems that pjax should be able to handle this situation.
If the html loaded by pjax does start with an
<html>
-tag but does not contain a<head>
- or just an empty<head/>
-tag, an error is thrown in extractContainer because the regex-match looking for content within<head></head>
-tags does not match and returnsnull
instead of an array.As the HTML-Specification enforces (at least as i understand it) that an
<html>
-tag always has an<head>
and a<body>
-tag but<head>
may be empty (<title>
is optional "when a higher-level protocol provides title information"), it seems that pjax should be able to handle this situation.