Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 08e45e1

Browse files
committed
Merge pull request #138 from gscscnd/as-headlink-attribute
Allow to use ‘as’ attribute on HTML ‘link’ element
2 parents 2340694 + 2ff736f commit 08e45e1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Helper/HeadLink.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class HeadLink extends Placeholder\Container\AbstractStandalone
5151
'extras',
5252
'itemprop',
5353
'crossorigin',
54-
'integrity'
54+
'integrity',
55+
'as',
5556
];
5657

5758
/**

test/Helper/HeadLinkTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,4 +457,10 @@ public function testItempropAttributeIsSupported()
457457
$this->helper->prependAlternate(['itemprop' => 'url', 'href' => '/bar/baz', 'rel' => 'canonical']);
458458
$this->assertContains('itemprop="url"', $this->helper->toString());
459459
}
460+
461+
public function testAsAttributeIsSupported()
462+
{
463+
$this->helper->headLink(['as' => 'style', 'href' => '/foo/bar.css', 'rel' => 'preload']);
464+
$this->assertContains('as="style"', $this->helper->toString());
465+
}
460466
}

0 commit comments

Comments
 (0)