Project

General

Profile

Actions

Defect #37237

closed

Common Markdown Formatter does not render all properties on HTML elements

Added by C S over 2 years ago. Updated about 2 years ago.

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

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Input:

<table align="center" border="0" cellpadding="1" cellspacing="1" style="width:100%; text-align:center; border-collapse:separate; border-spacing: 10px; display:table">
   <tr>
      <td class="InfoButton">Some Text</td>
   </tr>
</table>

Output:

<table align="center" border="0" cellpadding="1" cellspacing="1">
   <tr>
      <td>Some Text</td>
   </tr>
</table>


Files


Related issues

Related to Redmine - Feature #2416: {background:color} doesn't work in text formattingClosedJean-Philippe Lang2008-12-30

Actions
Related to Redmine - Feature #22425: Allow "style" tag in Redcarpet Markdown formatterClosed

Actions
Related to Redmine - Defect #38073: CommonMark Markdown formatter does not support min-width, max-width, min-height, and max-height CSS propertiesClosedGo MAEDA

Actions
Is duplicate of Redmine - Feature #35747: Allow style attribute for HTML elements in CommonMark formatterClosed

Actions
Actions #1

Updated by Anonymous over 2 years ago

  • File blog-categories-2022-05-13.csv added
Actions #2

Updated by Holger Just over 2 years ago

  • File deleted (blog-categories-2022-05-13.csv)
Actions #3

Updated by Anonymous over 2 years ago

  • File 24.gif added
Actions #4

Updated by Holger Just over 2 years ago

  • File deleted (24.gif)
Actions #5

Updated by Anonymous over 2 years ago

  • File 1161.gif added
Actions #6

Updated by Go MAEDA over 2 years ago

  • File deleted (1161.gif)
Actions #7

Updated by Anonymous over 2 years ago

  • File 1015.gif added
Actions #8

Updated by Go MAEDA over 2 years ago

  • File deleted (1015.gif)
Actions #9

Updated by C S about 2 years ago

Does anyone have an idea or even a work-around how I can add the HTML elements? Specifying a class and ID for the respective elements would be completely sufficient so that you can address them specifically via CSS file

Actions #10

Updated by Holger Just about 2 years ago

Right now, custom CSS rules are not allowed at all in Markdown. This is something that may change in the future though to allow a limited set of CSS rules. We have built this in Planio already and are currently preparing the patches for Redmine to contribute this.

As for custom class attributes, these are generally forbidden due to security concerns. As Redmine uses classes in its own generated HTML to show style its interfaces, allowing arbitrary classes could allow attackers to hide or affect critical UI details outside of the rendered markup which is thus forbidden.

Actions #11

Updated by Jens Krämer about 2 years ago

Here's a patch (extracted from Planio) that allows a limited set of CSS properties in CommonMark output. The second patch adds the corresponding list of allowed properties to the english documentation file.

Actions #12

Updated by Marius BĂLTEANU about 2 years ago

  • Target version set to 5.0.3
Actions #13

Updated by Mischa The Evil about 2 years ago

  • Related to Feature #2416: {background:color} doesn't work in text formatting added
Actions #14

Updated by Mischa The Evil about 2 years ago

  • Related to Feature #22425: Allow "style" tag in Redcarpet Markdown formatter added
Actions #15

Updated by Mischa The Evil about 2 years ago

I wonder: given the similarity with the list of properties kept in source:/trunk/lib/redmine/wiki_formatting/textile/redcloth3.rb@21848#L514 for the Textile formatter, wouldn't it be better to unify both of these and/or extract the list of properties into its own entirely (as it might be useful for other, third-party formatters too)? Would such be feasible?

Otherwise the patches look good to me... ;)

Actions #16

Updated by Jens Krämer about 2 years ago

Reusing parts of the commonmark HTML pipeline for the other formatters is definitely something we should do in the future. Makes a lot of sense especially for the Sanitizer, and if I'm not mistaken we could then throw out such formatter-specific sanitization like the one you pointed out.

Actions #17

Updated by Marius BĂLTEANU about 2 years ago

  • Status changed from New to Resolved
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Fixed

Patches committed, thanks.

I think we can handle the reusable part in another ticket.

Actions #18

Updated by Marius BĂLTEANU about 2 years ago

Fixes merged to 5.0.3.

Actions #19

Updated by Marius BĂLTEANU about 2 years ago

  • Status changed from Resolved to Closed
Actions #20

Updated by Go MAEDA almost 2 years ago

  • Related to Defect #38073: CommonMark Markdown formatter does not support min-width, max-width, min-height, and max-height CSS properties added
Actions #21

Updated by Go MAEDA about 1 year ago

  • Is duplicate of Feature #35747: Allow style attribute for HTML elements in CommonMark formatter added
Actions

Also available in: Atom PDF