File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @puzzle-js/client-lib" ,
33 "main" : " dist/index.js" ,
4- "version" : " 1.3.2 " ,
4+ "version" : " 1.3.3 " ,
55 "author" : " <emre.kul@trendyol.com>" ,
66 "license" : " MIT" ,
77 "repository" : {
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ export class Core extends Module {
169169 if ( ! key . startsWith ( '$' ) ) {
170170 const container = document . querySelector ( this . getFragmentContainerSelector ( fragment , key ) ) ;
171171 if ( container ) {
172- this . setEvalInnerHtml ( container , res [ key ] ) ;
172+ this . setEvalInnerHtml ( container , res [ key ] , container . tagName === "meta" ) ;
173173 }
174174 }
175175 } ) ;
@@ -180,7 +180,7 @@ export class Core extends Module {
180180 }
181181
182182 private static getFragmentContainerSelector ( fragment : IPageFragmentConfig , partial : string ) {
183- return partial === "main" ? `[puzzle-fragment="${ fragment . name } "]` : `[puzzle-fragment="${ fragment . name } "][fragment-partial="${ partial } "]` ;
183+ return partial === "main" ? `[puzzle-fragment="${ fragment . name } "]:not([fragment-partial]) ` : `[puzzle-fragment="${ fragment . name } "][fragment-partial="${ partial } "]` ;
184184 }
185185
186186 private static prepareQueryString ( fragmentAttributes : Record < string , string > ) {
@@ -195,7 +195,12 @@ export class Core extends Module {
195195 return Object . keys ( attributes ) . reduce ( ( query : string , key : string ) => `${ query } &${ key } =${ attributes [ key ] } ` , '?__renderMode=stream' ) ;
196196 }
197197
198- private static setEvalInnerHtml ( elm : any , html : any ) {
198+ private static setEvalInnerHtml ( elm : any , html : any , meta ?: boolean ) {
199+ if ( meta ) {
200+ elm . outerHTML = html ;
201+ return ;
202+ }
203+
199204 elm . innerHTML = html ;
200205 Array . from ( elm . querySelectorAll ( "script" ) ) . forEach ( ( oldScript : any ) => {
201206 const newScript = document . createElement ( "script" ) ;
You can’t perform that action at this time.
0 commit comments