File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed 
src/components/dialog/content/setting Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -54,4 +54,21 @@ describe('SettingItem', () => {
5454      {  text : 'Correctly Translated' ,  value : 'Correctly Translated'  } 
5555    ] ) 
5656  } ) 
57+ 
58+   it ( 'handles tooltips with @ symbols without errors' ,  ( )  =>  { 
59+     const  wrapper  =  mountComponent ( { 
60+       setting : { 
61+         id : 'TestSetting' , 
62+         name : 'Test Setting' , 
63+         type : 'boolean' , 
64+         tooltip :
65+           'This will load a larger version of @mtb/markdown-parser that bundles shiki' 
66+       } 
67+     } ) 
68+ 
69+     // Should not throw an error and tooltip should be preserved as-is 
70+     expect ( wrapper . vm . formItem . tooltip ) . toBe ( 
71+       'This will load a larger version of @mtb/markdown-parser that bundles shiki' 
72+     ) 
73+   } ) 
5774} ) 
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import { computed } from 'vue'
2828import  { useI18n  } from  ' vue-i18n' 
2929
3030import  FormItem  from  ' @/components/common/FormItem.vue' 
31+ import  { st  } from  ' @/i18n' 
3132import  { useSettingStore  } from  ' @/stores/settingStore' 
3233import  type  { SettingOption , SettingParams  } from  ' @/types/settingTypes' 
3334import  { normalizeI18nKey  } from  ' @/utils/formatUtil' 
@@ -64,7 +65,7 @@ const formItem = computed(() => {
6465    ... props .setting , 
6566    name: t (` settings.${normalizedId }.name ` , props .setting .name ), 
6667    tooltip: props .setting .tooltip  
67-       ?  t (` settings.${normalizedId }.tooltip ` , props .setting .tooltip ) 
68+       ?  st (` settings.${normalizedId }.tooltip ` , props .setting .tooltip ) 
6869      :  undefined , 
6970    options: props .setting .options  
7071      ?  translateOptions (props .setting .options ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments