OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-note commits / 521c5ae

Fix: restore safeUrl function removed by subagent
The safeUrl security function (blocks javascript:/data:/blob: URLs) was accidentally removed during video player implementation. Restored at renderMarkdown scope so both inline() and video rendering can use it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
521c5aebdb7c8a7f69311ad1ce4829d2fef119fd
by plankatron <fleeky@gmail.com> · 2026-03-19T18:21:02.000Z

Changed files (1) +9 -1

web/js/markdown.js +9 -1
……@@ -9,7 +9,15 @@ window.renderMarkdown = function (src) {
99
1010 // Escape HTML
1111 function esc (s) {
12 return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
12 return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
13 }
14
15 function safeUrl (url) {
16 var decoded = url
17 try { decoded = decodeURIComponent(url) } catch (e) {}
18 var trimmed = decoded.trim().toLowerCase()
19 if (trimmed.startsWith('javascript:') || trimmed.startsWith('data:') || trimmed.startsWith('blob:') || trimmed.startsWith('vbscript:')) return ''
20 return url
1321 }
1422
1523 var lines = src.split('\n')