mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
open markdown links in new window/tab (#6229)
## Summary Changes links in markdown snippets (What's New popup, node info sidebar) to open the link in a new tab/window rather than directly navigating and potentially losing unsaved work. https://github.com/user-attachments/assets/24331bba-e31a-484c-bc11-12cf61805c98 Fixes https://github.com/Comfy-Org/ComfyUI_frontend/issues/6223. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6229-open-markdown-links-in-new-window-tab-2956d73d365081edbb1efb21cd0e2ab2) by [Unito](https://www.unito.io) --------- Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
@@ -15,8 +15,8 @@ vi.mock('vue-i18n', () => ({
|
||||
}))
|
||||
}))
|
||||
|
||||
vi.mock('marked', () => ({
|
||||
marked: vi.fn((content) => `<p>${content}</p>`)
|
||||
vi.mock('@/utils/markdownRendererUtil', () => ({
|
||||
renderMarkdownToHtml: vi.fn((content) => `<p>${content}</p>`)
|
||||
}))
|
||||
|
||||
vi.mock('@/platform/updates/common/releaseStore', () => ({
|
||||
@@ -119,7 +119,7 @@ describe('WhatsNewPopup', () => {
|
||||
})
|
||||
|
||||
describe('content rendering', () => {
|
||||
it('should render release content using marked', async () => {
|
||||
it('should render release content using renderMarkdownToHtml', async () => {
|
||||
mockReleaseStore.shouldShowPopup = true
|
||||
mockReleaseStore.recentRelease = {
|
||||
id: 1,
|
||||
@@ -132,7 +132,7 @@ describe('WhatsNewPopup', () => {
|
||||
|
||||
const wrapper = createWrapper()
|
||||
|
||||
// Check that the content is rendered (marked is mocked to return processed content)
|
||||
// Check that the content is rendered (renderMarkdownToHtml is mocked to return processed content)
|
||||
expect(wrapper.find('.content-text').exists()).toBe(true)
|
||||
const contentHtml = wrapper.find('.content-text').html()
|
||||
expect(contentHtml).toContain('<p># Release Notes')
|
||||
|
||||
Reference in New Issue
Block a user