+ /**
+ * Determines whether the given route is a HTML route.
+ *
+ * @param \Symfony\Component\Routing\Route $route
+ * The route to analyze.
+ *
+ * @return bool
+ * TRUE if HTML is a valid format for this route.
+ */
+ protected static function isHtmlRoute(Route $route) {
+ // If a route has no explicit format, then HTML is valid.
+ $format = $route->hasRequirement('_format') ? explode('|', $route->getRequirement('_format')) : ['html'];
+ return in_array('html', $format, TRUE);
+ }
+