Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b41d91c

Browse files
committed
Accept space at end of style="x: y; " (related to issue 83).
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401232
1 parent 70608a6 commit b41d91c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/html5/sanitizer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def sanitize_css(style)
168168

169169
# gauntlet
170170
return '' unless style =~ /^([-:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*$/
171-
return '' unless style =~ /^(\s*[-\w]+\s*:[^:;]*(;|$))*$/
171+
return '' unless style =~ /^\s*([-\w]+\s*:[^:;]*(;\s*|$))*$/
172172

173173
clean = []
174174
style.scan(/([-\w]+)\s*:\s*([^:;]*)/) do |prop, val|

0 commit comments

Comments
 (0)