Skip to content

Commit fc94123

Browse files
christian-byrnelordTyrion
authored andcommitted
[fix] resolve @ symbol parsing errors in extension tooltips (Comfy-Org#4100)
1 parent 36869ed commit fc94123

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/components/dialog/content/setting/SettingItem.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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
})

src/components/dialog/content/setting/SettingItem.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { computed } from 'vue'
2828
import { useI18n } from 'vue-i18n'
2929
3030
import FormItem from '@/components/common/FormItem.vue'
31+
import { st } from '@/i18n'
3132
import { useSettingStore } from '@/stores/settingStore'
3233
import type { SettingOption, SettingParams } from '@/types/settingTypes'
3334
import { 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)

0 commit comments

Comments
 (0)