Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1235504
  • 博文数量: 264
  • 博客积分: 10772
  • 博客等级: 上将
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-25 11:54
文章分类

全部博文(264)

文章存档

2012年(4)

2011年(51)

2010年(31)

2009年(57)

2008年(51)

2007年(70)

分类: LINUX

2011-07-17 14:30:03


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 ():

“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 /lib/redmine/wiki_formatting/textile/ directory.

Line #33: Textile Inline Styles Off:

1self.filter_styles=true

Line #33: Textile Inline Styles On:

1self.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:

1table{border:1px solid black}.
2{background:#999}. |_. Column One |_. Column Two|_. Column Three|
3{background:#333}. |Row One|Row One|Row One |
4{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.
阅读(8910) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~