mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed async loading on assets pipeline output
This commit is contained in:
parent
e4aad9797d
commit
12ca443cb4
|
|
@ -1,3 +1,9 @@
|
|||
# v1.1.0-beta.3
|
||||
## xx/xx/2016
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fixed handling of `{'loading':'async'}` with Assets Pipeline
|
||||
|
||||
# v1.1.0-beta.2
|
||||
## 04/27/2016
|
||||
|
||||
|
|
|
|||
|
|
@ -1005,7 +1005,7 @@ class Assets
|
|||
protected function isRemoteLink($link)
|
||||
{
|
||||
$base = Grav::instance()['uri']->rootUrl(true);
|
||||
|
||||
|
||||
// sanity check for local URLs with absolute URL's enabled
|
||||
if (Utils::startsWith($link, $base)) {
|
||||
return false;
|
||||
|
|
@ -1042,6 +1042,7 @@ class Assets
|
|||
protected function attributes(array $attributes)
|
||||
{
|
||||
$html = '';
|
||||
$no_key = ['loading'];
|
||||
|
||||
foreach ($attributes as $key => $value) {
|
||||
// For numeric keys we will assume that the key and the value are the same
|
||||
|
|
@ -1054,7 +1055,12 @@ class Assets
|
|||
$value = implode(' ', $value);
|
||||
}
|
||||
|
||||
$element = $key . '="' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '"';
|
||||
if (in_array($key, $no_key)) {
|
||||
$element = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
|
||||
} else {
|
||||
$element = $key . '="' . htmlentities($value, ENT_QUOTES, 'UTF-8', false) . '"';
|
||||
}
|
||||
|
||||
$html .= ' ' . $element;
|
||||
}
|
||||
|
||||
|
|
@ -1114,8 +1120,8 @@ class Assets
|
|||
$file = $this->cssRewrite($file, $relative_dir);
|
||||
}
|
||||
|
||||
$file = rtrim($file) . PHP_EOL;
|
||||
$buffer .= $file;
|
||||
$file = rtrim($file) . PHP_EOL;
|
||||
$buffer .= $file;
|
||||
}
|
||||
|
||||
// Pull out @imports and move to top
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user