Files
wekan/packages/markdown/package.js
T
Lauri Ojansivu 38ce497887 Admin Panel / Features / Security: "Always show all code as plain text"
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.
2026-07-14 13:17:33 +03:00

20 lines
515 B
JavaScript

Package.describe({
name: 'wekan-markdown',
summary: 'GitHub flavored markdown parser for Meteor based on markdown-it',
version: '1.0.9',
git: 'https://github.com/wekan/markdown.git',
});
Package.onUse(function (api) {
api.versionsFrom(['2.16', '3.0']);
api.use('templating');
api.use('reactive-var', 'client');
api.use("ecmascript", ['server', 'client']);
api.export('Markdown', ['server', 'client']);
api.use('ui', 'client', {weak: true});
api.addFiles('src/template-integration.js', 'client');
});