• Home »
  • Insights »
  • Redmine: Textile Style Formatting Not Working, Textile Inline Styles Not Working

Redmine: Textile Style Formatting Not Working, Textile Inline Styles Not Working

The Redmine developers turned off Textile inline styles because of a security risk with XSS attacks. I explain below how to turn the inline styles back on if your Redmine server is protected from unauthorized access. I would suggest keeping textile styles off if your Redmine server has public access. The main point of this article is to point out that the styling such as background colors, css, table borders, cell borders, etc. is turned off by default.

If you do decide to turn inline styles back on using the information below then here is a note from the Textile Reference Manual (link):

“Developers can easily include Textile in any web application that accepts user input for display on web pages. Textile supports UTF-8 input, and produces valid XHTML. A “Restricted” mode is available for processing input from untrusted users, where invalid input and XSS attacks are a risk”

To turn the styling back on simply modify the below statement which is located in the formatter.rb file which resides in the <redmine-root>/lib/redmine/wiki_formatting/textile/ directory.

Line #33: Textile Inline Styles Off:

self.filter_styles=true

Line #33: Textile Inline Styles On:

self.filter_styles=false

Now with the inline styles turned back on you can add lines like the below in Textile input boxes and the formatting will appear correctly.

Example Textile Formatting With Inline Style:

table{border:1px solid black}.
{background:#999}. |_. Column One |_. Column Two|_. Column Three|
{background:#333}. |Row One|Row One|Row One |
{background:#666}. |Row TwoRow Two |Row Two |

The above will create a table using Textile. The table will have a solid black 1 pixel wide outline. There will also be a table header row followed by two rows of alternating colors.


List Price: $39.99 USD
New From: $3.51 USD In Stock
Used from: $0.01 USD In Stock

Share