Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added-list-style-type-attribute-to-acceptable-css-properties-includin… #137

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/loofah.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#
module Loofah
# The version of Loofah you are using
VERSION = '2.1.1'
VERSION = '2.1.2'

class << self
# Shortcut for Loofah::HTML::Document.parse
Expand Down
2 changes: 1 addition & 1 deletion lib/loofah/html5/whitelist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module WhiteList
pause pause-after pause-before pitch pitch-range richness speak
speak-header speak-numeral speak-punctuation speech-rate stress
text-align text-decoration text-indent unicode-bidi vertical-align
voice-family volume white-space width]
voice-family volume white-space width list-style-type]

ACCEPTABLE_CSS_KEYWORDS = Set.new %w[auto aqua black block blue bold both bottom
brown center collapse dashed dotted fuchsia gray green !important
Expand Down
Binary file added loofah-2.1.2.gem
Binary file not shown.
2 changes: 1 addition & 1 deletion loofah.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Gem::Specification.new do |s|
s.name = "loofah".freeze
s.version = "2.1.1.20170924234214"
s.version = "2.1.2"

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
Expand Down
8 changes: 7 additions & 1 deletion test/html5/test_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_should_allow_multi_word_data_attributes
check_sanitization(input, output, output, output)
end
end

HTML5::WhiteList::ALLOWED_URI_DATA_MEDIATYPES.each do |data_uri_type|
define_method "test_should_allow_data_#{data_uri_type}_uris" do
input = %(<a href="data:#{data_uri_type}">foo</a>)
Expand Down Expand Up @@ -275,6 +275,12 @@ def test_css_negative_value_sanitization_shorthand_css_properties
assert_match %r/-0.05em/, sane.inner_html
end

def test_css_function_sanitization_leaves_whitelisted_functions
html = "<ol style='list-style-type:lower-greek;'></ol>"
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :strip).to_html)
assert_match %r/list-style-type:lower-greek/, sane.inner_html
end

def test_issue_90_slow_regex
skip("timing tests are hard to make pass and have little regression-testing value")

Expand Down