feat: 优化内容模板变量引用与换行展示

- 内容模板直接引用上游参数并自动维护运行参数

- 支持 Enjoy 变量标签编辑及中文变量显示

- 保留试运行与聊天运行页的模板输出换行
This commit is contained in:
2026-08-11 21:41:58 +08:00
parent fe41d62b8a
commit 765006747a
12 changed files with 419 additions and 67 deletions

View File

@@ -1,7 +1,7 @@
import {mount} from '@vue/test-utils';
import {nextTick} from 'vue';
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import {describe, expect, it, vi} from 'vitest';
import { describe, expect, it, vi } from 'vitest';
import ChatTimeMarkdown from '../ChatTimeMarkdown.vue';
@@ -11,7 +11,21 @@ vi.mock('@easyflow-core/preferences', () => ({
}),
}));
describe('ChatTimeMarkdown', () => {
describe('chatTimeMarkdown', () => {
it('renders a single source line break as a visible line break', async () => {
const wrapper = mount(ChatTimeMarkdown, {
props: {
content: '问题:你是谁\n答案你好',
},
});
await nextTick();
expect(wrapper.text()).toContain('问题:你是谁');
expect(wrapper.text()).toContain('答案:你好');
expect(wrapper.find('br').exists()).toBe(true);
});
it('renders mermaid code fences with the shared mermaid block', async () => {
const wrapper = mount(ChatTimeMarkdown, {
props: {