Parcourir la source

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

Gildas il y a 7 ans
Parent
commit
ac2f4d9951
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  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 {