Add markdown rendering for read-only document viewer#235
Add markdown rendering for read-only document viewer#235zarvox32 merged 6 commits intoXGDevGroup:mainfrom
Conversation
Review by Claude (Opus 4.6)Requested by the PR reviewer; posted verbatim. Overview
Smoke test (ran locally in an ephemeral env)
Issues (ranked)1. Raw HTML / script injection — real concern 2. Gating on 3. Empty document falls through to plain-text editor 4. No tests added 5. Accessibility — must verify interactively before merge 6. No WebView2 fallback 7. Style nits
RecommendationRequest changes on items 1 and 5 (must-fix), 2 and 6 (should-fix), 3, 4, 7 (nice-to-fix). Item 1 is the blocker — landing this without HTML sanitization introduces a real XSS surface through the documents system. |
…read_only+multiline heuristic
…loufi/PlayPalace11 into feature/markdown-docs
|
Done. I fixed 1 and 2. The problem of js code injection is one didn't cross my mind at first but now it's fixed. Couldn't add proper tests for number 4 in time though sorry, though from my testing it's working. Regarding 5, the new view is accessible with NVDA. |
Summary
Replaces the plain-text read-only document viewer with a rendered Markdown viewer. Documents now display with proper headings, bold/italic, lists, tables, and code blocks instead of raw markdown syntax.
Changes
MarkdownViewerDialog(clients/desktop/ui/markdown_viewer_dialog.py)python-markdownwith extensions:tables,fenced_code,sane_lists,nl2brwx.html2.WebView(Edge/WebView2 backend on Windows)wx.SystemSettings) — respects dark mode and high-contrast themeswxEVT_WEBVIEW_LOADEDfor screen reader accesson_server_request_input()(clients/desktop/ui/main_window.py)read_only=TrueANDmultiline=True→ opensMarkdownViewerDialoginstead of a plainwx.TextCtrleditbox(text="")response as beforemarkdown>=3.5added topyproject.tomlTesting
cd clients/desktop && uv syncto install the newmarkdowndependency