mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
New optional toggle under Admin Panel / Features / Security. When enabled, rich text is never rendered as markdown or HTML -- the entire source is shown as escaped plain text in every rich text field (board and card titles, descriptions, comments, checklists, etc.), so hidden content is always revealed: HTML comments (<!-- -->), the target URL inside a markdown link, JavaScript and any other code. All code is always visible, not clickable, and not running. This extends the existing invisiblebleed protection (which already showed raw source for description-less markdown links) to all content, and complements the "Render links as plain text" toggle. Implementation: - New global setting alwaysShowCodeAsText (models/settings.js), published in the public setting publication, default off. - Admin Panel / Features / Security gains a second materialCheckBox toggle. - The markdown helper has the raw text, so the decision lives there. Because the wekan-markdown package cannot import app code, the setting is bridged via a ReactiveVar on the exported Markdown object; the rich text viewer (editor.js) keeps it in sync with the setting reactively, and the markdown helper reads it and renders the fully HTML-escaped source in a <pre> when on. Full escaping (not DOMPurify stripping) ensures tags like <script> are shown as text rather than removed. The description-less-link branch now uses the same full escaping so it too reveals all source.