Project

General

Profile

Actions

Patch #16087

closed

Markdown renderer doesn’t clean HTML properly

Added by Charmander - about 10 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The current renderer strips HTML (contrary to conventional Markdown) and still fails to catch everything:

[bad link](javascript:alert(1\))

This fixes both behaviours. scrub-classes is a patch to remove unrecognized classes that could potentially be used to annoy; I haven’t completed the list because the existing implementation already allows all classes through syntax highlighting:

~~~any-class-here
code block
~~~

Files

redmine-markdown-loofah.diff (2.42 KB) redmine-markdown-loofah.diff the main patch Charmander -, 2014-02-13 03:43
redmine-markdown-scrub-classes.diff (1.53 KB) redmine-markdown-scrub-classes.diff Charmander -, 2014-02-13 03:45
Actions #1

Updated by Charmander - about 10 years ago

This one needs a more comprehensive list of acceptable classes.

Actions #2

Updated by Charmander - almost 10 years ago

ahem

Actions #4

Updated by Charmander - almost 10 years ago

Yes, one is already included in that patch.

Actions #5

Updated by Toshi MARUYAMA almost 10 years ago

Please add test cases in your patch.

Actions #6

Updated by Charmander - almost 10 years ago

Like I said, the patch includes a test case.

Actions #7

Updated by Charmander - over 9 years ago

ahem

Actions #8

Updated by Charmander - almost 9 years ago

Okay, I’ve added tests to my patch.

Actions #9

Updated by Go MAEDA about 5 years ago

  • Status changed from New to Closed

Current versions of Redmine don't render [bad link](javascript:alert(1\)). And code blocks don't accept unknown language name (r16501 and r16502).

Actions

Also available in: Atom PDF