Skip to content

Commit e9ea91d

Browse files
committed
Remove <link rel="import">s when publishing.
1 parent 0cb7230 commit e9ea91d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

publish.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ limitations under the License.
9090
inlineImages(doc.getElementsByTagName('img'));
9191

9292
var copy = doc.cloneNode(true);
93-
forEach(copy.querySelectorAll('cxx-publish-button'), function(node) {
94-
node.remove();
95-
});
96-
forEach(copy.querySelectorAll('script'), function(node) {
97-
node.remove();
93+
94+
// Remove elements that run code or don't contribute to the appearance
95+
// of the page.
96+
forEach(['cxx-publish-button', 'script', 'link[rel=import]'],
97+
function(selector) {
98+
forEach(copy.querySelectorAll(selector), function(node) {
99+
node.remove();
100+
});
98101
});
99102
forEach(copy.body.querySelectorAll('*'), function(node) {
100103
if (getComputedStyle(node).display === 'none') {

0 commit comments

Comments
 (0)