mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 15:31:12 +00:00
Allow "max-height", "max-width", "min-height" and "min-width" CSS properties in Textile (#26552).
Patch by Michael Gerz and Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17173 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9bf152c5b0
commit
e4142a8338
@ -514,7 +514,7 @@ class RedCloth3 < String
|
|||||||
atts
|
atts
|
||||||
end
|
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)
|
def sanitize_styles(str)
|
||||||
styles = str.split(";").map(&:strip)
|
styles = str.split(";").map(&:strip)
|
||||||
|
|||||||
@ -80,6 +80,8 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase
|
|||||||
'p{border-right:1px}. text' => '<p style="border-right:1px;">text</p>',
|
'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-top:1px}. text' => '<p style="border-top:1px;">text</p>',
|
||||||
'p{border-bottom:1px}. text' => '<p style="border-bottom: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)
|
}, false)
|
||||||
|
|
||||||
# multiple styles
|
# multiple styles
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user