File tree Expand file tree Collapse file tree 1 file changed +22
-13
lines changed
packages/shared-utils/src Expand file tree Collapse file tree 1 file changed +22
-13
lines changed Original file line number Diff line number Diff line change @@ -359,20 +359,29 @@ export function getCustomFunctionDetails (func: Function): CustomState {
359
359
}
360
360
361
361
export function getCustomHTMLElementDetails ( value : HTMLElement ) : CustomState {
362
- return {
363
- _custom : {
364
- type : 'HTMLElement' ,
365
- display : `<span class="opacity-30"><</span><span class="text-blue-500">${ value . tagName . toLowerCase ( ) } </span><span class="opacity-30">></span>` ,
366
- value : namedNodeMapToObject ( value . attributes ) ,
367
- actions : [
368
- {
369
- icon : 'input' ,
370
- tooltip : 'Log element to console' ,
371
- action : ( ) => {
372
- console . log ( value )
362
+ try {
363
+ return {
364
+ _custom : {
365
+ type : 'HTMLElement' ,
366
+ display : `<span class="opacity-30"><</span><span class="text-blue-500">${ value . tagName . toLowerCase ( ) } </span><span class="opacity-30">></span>` ,
367
+ value : namedNodeMapToObject ( value . attributes ) ,
368
+ actions : [
369
+ {
370
+ icon : 'input' ,
371
+ tooltip : 'Log element to console' ,
372
+ action : ( ) => {
373
+ console . log ( value )
374
+ }
373
375
}
374
- }
375
- ]
376
+ ]
377
+ }
378
+ }
379
+ } catch ( e ) {
380
+ return {
381
+ _custom : {
382
+ type : 'HTMLElement' ,
383
+ display : `<span class="text-blue-500">${ String ( value ) } </span>`
384
+ }
376
385
}
377
386
}
378
387
}
You can’t perform that action at this time.
0 commit comments