Support Firefox for PortableInfoboxBuilder (#83)

This commit is contained in:
CosmicAlpha 2022-12-17 15:44:04 -07:00 committed by GitHub
parent aa6eec615f
commit 6ea00e62e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,9 +227,16 @@
if ( this.xsltProcessor ) {
let transformed = this.xsltProcessor.transformToDocument( markup );
if ( transformed ) {
return this.xmlSerializer.serializeToString( transformed )
let result = this.xmlSerializer.serializeToString( transformed )
.replace( /(?<=^ *) /mg, '\t' );
if ( result.indexOf( '<transformiix:result' ) > -1 ) {
return '<infobox>' + result.substring( result.indexOf( '>' ) + 1, result.lastIndexOf( '<' ) ) + '</infobox>';
}
return result;
}
}