mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 00:39:47 +08:00
Add rich text and learning blocks, media uploads, page trees, and revisioned notebook storage. Present AI suggestions at their target blocks with durable accept and dismiss actions. Unify saved outputs as Favorites with typed expandable blocks, stable source links, atomic batch insertion, nesting, dragging, and undo/redo. Validation: 99 frontend tests and 99 backend tests pass in an isolated snapshot, along with TypeScript, scoped ESLint, dependency architecture, and locale parity checks.
7 lines
266 B
TypeScript
7 lines
266 B
TypeScript
/** Same policy as the persisted note schema; never render executable URLs. */
|
|
export function safeNoteUrl(value: unknown): string | null {
|
|
return typeof value === 'string' && /^(https?:\/\/|mailto:|\/(?!\/)|#)/i.test(value.trim())
|
|
? value.trim()
|
|
: null
|
|
}
|