diff -u b/modules/tome_static/src/StaticGenerator.php b/modules/tome_static/src/StaticGenerator.php --- b/modules/tome_static/src/StaticGenerator.php +++ b/modules/tome_static/src/StaticGenerator.php @@ -375,6 +375,12 @@ } } } + /** @var \DOMElement $node */ + foreach ($xpath->query('//svg/use') as $node) { + if ($node->hasAttribute('xlink:href')) { + $paths[] = $node->getAttribute('xlink:href'); + } + } $rels = [ 'stylesheet', 'shortcut icon', @@ -385,13 +391,6 @@ } } } - /** @var \DOMElement $svg */ - // Export SVG paths. - foreach ($xpath->query('//svg/use') as $svg) { - if ($svg->hasAttribute('xlink:href')) { - $paths[] = $svg->getAttribute('xlink:href'); - } - } $rels = [ 'stylesheet', 'shortcut icon', only in patch2: unchanged: --- a/modules/tome_static/tests/modules/tome_test/src/Controller/TestController.php +++ b/modules/tome_static/tests/modules/tome_test/src/Controller/TestController.php @@ -28,7 +28,7 @@ class TestController extends ControllerBase { public function testComplexPage(Request $request) { $module_path = drupal_get_path('module', 'tome_test'); return [ - '#markup' => "

Hello, complex world

+ '#children' => "

Hello, complex world

@@ -37,8 +37,8 @@ class TestController extends ControllerBase { -", - '#allowed_tags' => ['img', 'p', 'source', 'a', 'iframe'], + +", '#attached' => [ 'library' => [ 'tome_test/complex_page', only in patch2: unchanged: --- a/modules/tome_static/tests/src/Kernel/StaticGeneratorTest.php +++ b/modules/tome_static/tests/src/Kernel/StaticGeneratorTest.php @@ -221,7 +221,8 @@ class StaticGeneratorTest extends TestBase { $this->assertNotContains('http://www.google.com/external/path', $invoke_paths); $this->assertContains('/path/with/destination?bar=baz', $invoke_paths); $this->assertContains('/random/iframe', $invoke_paths); - $this->assertContains("/core/assets/vendor/html5shiv/html5shiv.min.js?v=3.7.3", $invoke_paths); + $this->assertContains('/core/assets/vendor/html5shiv/html5shiv.min.js?v=3.7.3', $invoke_paths); + $this->assertContains('/use.svg', $invoke_paths); $static->exportPaths($invoke_paths); $base_dir = Settings::get('tome_static_directory');