From 7caa78f3184faaff353f0486db08bd7b35aee87e Mon Sep 17 00:00:00 2001 From: bboysoul Date: Fri, 11 Sep 2026 17:37:53 +0800 Subject: [PATCH] feat: improve task note markdown editor --- frontend/src/App.vue | 49 ++++++++++++++-- frontend/src/lib/task-utils.test.ts | 17 +++++- frontend/src/lib/task-utils.ts | 87 ++++++++++++++++++++++++++--- frontend/src/style.css | 2 +- frontend/src/style.test.ts | 18 +++++- 5 files changed, 156 insertions(+), 17 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 5414c10..8100b30 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,11 +1,11 @@ ') + it('renders safe practical markdown and strips unsafe html', () => { + const html = renderMarkdown('# Plan\n> Note\n1. first\n- [x] done\n\n```js\nconst x = 1\n```\n**bold** [link](https://example.com)\n') expect(html).toContain('

Plan

') + expect(html).toContain('
Note
') + expect(html).toContain('
  1. first
') + expect(html).toContain('type="checkbox" disabled checked') + expect(html).toContain('
const x = 1
') expect(html).toContain('bold') expect(html).toContain('rel="noopener noreferrer"') expect(html).not.toContain('