]> source.dussan.org Git - redmine.git/commitdiff
Allow "max-height", "max-width", "min-height" and "min-width" CSS properties in Texti...
authorGo MAEDA <maeda@farend.jp>
Thu, 11 Jan 2018 01:32:18 +0000 (01:32 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 11 Jan 2018 01:32:18 +0000 (01:32 +0000)
Patch by Michael Gerz and Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@17173 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/textile/redcloth3.rb
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb

index 7ed29bbd8df60f62aee821c97e3b4406b71b8627..291a0e2d41b3f44028428bbdd5e11063930cf1a6 100644 (file)
@@ -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)
index 76c954b4b87586c075d2d64a7b4b75bbd69b193f..e0a8f73398447e20279c021db12ab588375369a2 100644 (file)
@@ -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