summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/redmine/wiki_formatting/textile/redcloth3.rb2
-rw-r--r--test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index 7ed29bbd8..291a0e2d4 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -514,7 +514,7 @@ class RedCloth3 < String
atts
end
- STYLES_RE = /^(color|width|height|border|background|padding|margin|font|text|float)(-[a-z]+)*:\s*((\d+%?|\d+px|\d+(\.\d+)?em|#[0-9a-f]+|[a-z]+)\s*)+$/i
+ STYLES_RE = /^(color|(min-|max-)?+(width|height)|border|background|padding|margin|font|text|float)(-[a-z]+)*:\s*((\d+%?|\d+px|\d+(\.\d+)?em|#[0-9a-f]+|[a-z]+)\s*)+$/i
def sanitize_styles(str)
styles = str.split(";").map(&:strip)
diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
index 76c954b4b..e0a8f7339 100644
--- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
@@ -80,6 +80,8 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase
'p{border-right:1px}. text' => '<p style="border-right:1px;">text</p>',
'p{border-top:1px}. text' => '<p style="border-top:1px;">text</p>',
'p{border-bottom:1px}. text' => '<p style="border-bottom:1px;">text</p>',
+ 'p{max-width:100px}. text' => '<p style="max-width:100px;">text</p>',
+ 'p{width:50px}. text' => '<p style="width:50px;">text</p>',
}, false)
# multiple styles