Explorar o código

fixed issue when the base tag is already present in the doc

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
9db256227b
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lib/single-file/single-file-core.js

+ 2 - 1
lib/single-file/single-file-core.js

@@ -127,6 +127,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		constructor(options) {
 			this.options = options;
 			this.options.url = this.options.url || this.options.doc.location.href;
+			this.options.baseURI = this.options.doc && this.options.doc.baseURI;
 			this.batchRequest = new BatchRequest();
 			this.processor = new DOMProcessor(options, this.batchRequest);
 			if (this.options.doc) {
@@ -255,7 +256,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		constructor(options, batchRequest) {
 			this.options = options;
 			this.stats = new Stats(options);
-			this.baseURI = DomUtil.normalizeURL(options.url);
+			this.baseURI = DomUtil.normalizeURL(options.baseURI || options.url);
 			this.batchRequest = batchRequest;
 		}