mirror of
https://github.com/redmine/redmine.git
synced 2026-08-02 00:51:04 +02:00
Allow use of the CSS text-decoration property in text formatting (#42444).
Patch by Go MAEDA (user:maeda). git-svn-id: https://svn.redmine.org/redmine/trunk@24527 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -375,7 +375,7 @@ It can be expanded by clicking a link.
|
||||
margin margin-left margin-right margin-top margin-bottom
|
||||
border border-left border-right border-top border-bottom border-radius border-style border-collapse border-spacing
|
||||
font font-style font-variant font-weight font-stretch font-size line-height font-family
|
||||
text-align
|
||||
text-align text-decoration
|
||||
float
|
||||
</code></pre>
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ To go live, all you need to add is a database and a web server.
|
||||
margin margin-left margin-right margin-top margin-bottom
|
||||
border border-left border-right border-top border-bottom border-radius border-style border-collapse border-spacing
|
||||
font font-style font-variant font-weight font-stretch font-size line-height font-family
|
||||
text-align
|
||||
text-align text-decoration
|
||||
float
|
||||
</code></pre>
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ module Redmine
|
||||
margin margin-left margin-right margin-top margin-bottom
|
||||
border border-left border-right border-top border-bottom border-radius border-style border-collapse border-spacing
|
||||
font font-style font-variant font-weight font-stretch font-size line-height font-family
|
||||
text-align
|
||||
text-align text-decoration
|
||||
float
|
||||
].freeze
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ class RedCloth3 < String
|
||||
atts
|
||||
end
|
||||
|
||||
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
|
||||
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]+(?:-[a-z]+)*)\s*)+$/i
|
||||
|
||||
def sanitize_styles(str)
|
||||
styles = str.split(";").map(&:strip)
|
||||
|
||||
@@ -131,7 +131,7 @@ if Object.const_defined?(:Commonmarker)
|
||||
],
|
||||
[
|
||||
'<b>Lo<!-- comment -->rem</b> <a href="pants" title="foo" style="text-decoration: underline;">ipsum</a> <a href="http://example.com/"><strong>dolor</strong></a> sit<br/>amet <style>.foo { color: #fff; }</style> <script>alert("hello world");</script>',
|
||||
'<b>Lorem</b> <a href="pants" title="foo">ipsum</a> <a href="http://example.com/"><strong>dolor</strong></a> sit<br>amet .foo { color: #fff; } '
|
||||
'<b>Lorem</b> <a href="pants" title="foo" style="text-decoration: underline;">ipsum</a> <a href="http://example.com/"><strong>dolor</strong></a> sit<br>amet .foo { color: #fff; } '
|
||||
],
|
||||
[
|
||||
'Lo<!-- comment -->rem</b> <a href=pants title="foo>ipsum <a href="http://example.com/"><strong>dolor</a></strong> sit<br/>amet <script>alert("hello world");',
|
||||
|
||||
@@ -86,6 +86,7 @@ class Redmine::WikiFormatting::TextileFormatterTest < Redmine::HelperTest
|
||||
'p{max-width:100px}. text' => '<p style="max-width:100px;">text</p>',
|
||||
'p{height:40px}. text' => '<p style="height:40px;">text</p>',
|
||||
'p{max-height:80px}. text' => '<p style="max-height:80px;">text</p>',
|
||||
'p{text-decoration: line-through}. text' => '<p style="text-decoration: line-through;">text</p>',
|
||||
},
|
||||
false
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user