Bladeren bron

copy rel and title attributes of link tags into newly created style tags

Gildas 7 jaren geleden
bovenliggende
commit
ac2f4d9951
1 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  1. 6 0
      lib/single-file/single-file-core.js

+ 6 - 0
lib/single-file/single-file-core.js

@@ -863,6 +863,12 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 					if (linkElement.media) {
 						styleElement.media = linkElement.media;
 					}
+					if (linkElement.rel) {
+						styleElement.rel = linkElement.rel;
+					}
+					if (linkElement.title) {
+						styleElement.title = linkElement.title;
+					}
 					styleElement.textContent = stylesheetContent;
 					linkElement.parentElement.replaceChild(styleElement, linkElement);
 				} else {