ruby-sanitize: Import ruby-sanitize-2.1.1 as wip/ruby-sanitize
Sanitize is a whitelist-based HTML and CSS sanitizer. Given a list of acceptable elements, attributes, and CSS properties, Sanitize will remove all unacceptable HTML and/or CSS from a string. Using a simple configuration syntax, you can tell Sanitize to allow certain HTML elements, certain attributes within those elements, and even certain URL protocols within attributes that contain URLs. You can also whitelist CSS properties, @ rules, and URL protocols you wish to allow in elements or attributes containing CSS. Any HTML or CSS that you don't explicitly allow will be removed. Sanitize is based on Google's Gumbo HTML5 parser, which parses HTML exactly the same way modern browsers do, and Crass, which parses CSS exactly the same way modern browsers do. As long as your whitelist config only allows safe markup and CSS, even the most malformed or malicious input will be transformed into safe output.
This commit is contained in:
parent
4db22a7d00
commit
0f8c09c4f0
1
Makefile
1
Makefile
|
@ -4353,6 +4353,7 @@ SUBDIR+= ruby-review
|
|||
SUBDIR+= ruby-rinku
|
||||
SUBDIR+= ruby-roo-xls
|
||||
SUBDIR+= ruby-rouge
|
||||
SUBDIR+= ruby-sanitize
|
||||
SUBDIR+= ruby-simple-navigation
|
||||
SUBDIR+= ruby-sinatra-simple-navigation
|
||||
SUBDIR+= ruby-taskwarrior-web
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
Sanitize is a whitelist-based HTML and CSS sanitizer. Given a list of
|
||||
acceptable elements, attributes, and CSS properties, Sanitize will
|
||||
remove all unacceptable HTML and/or CSS from a string.
|
||||
|
||||
Using a simple configuration syntax, you can tell Sanitize to allow
|
||||
certain HTML elements, certain attributes within those elements, and
|
||||
even certain URL protocols within attributes that contain URLs. You
|
||||
can also whitelist CSS properties, @ rules, and URL protocols you wish
|
||||
to allow in elements or attributes containing CSS. Any HTML or CSS
|
||||
that you don't explicitly allow will be removed.
|
||||
|
||||
Sanitize is based on Google's Gumbo HTML5 parser, which parses HTML
|
||||
exactly the same way modern browsers do, and Crass, which parses CSS
|
||||
exactly the same way modern browsers do. As long as your whitelist
|
||||
config only allows safe markup and CSS, even the most malformed or
|
||||
malicious input will be transformed into safe output.
|
|
@ -0,0 +1,14 @@
|
|||
# $NetBSD$
|
||||
|
||||
DISTNAME= sanitize-2.1.1
|
||||
CATEGORIES= textproc
|
||||
|
||||
MAINTAINER= pkgsrc-users@NetBSD.org
|
||||
HOMEPAGE= https://github.com/rgrove/sanitize
|
||||
COMMENT= Ruby HTML and CSS sanitizer
|
||||
LICENSE= mit
|
||||
|
||||
DEPENDS+= ${RUBY_PKGPREFIX}-nokogiri>=1.4.4:../../textproc/ruby-nokogiri
|
||||
|
||||
.include "../../lang/ruby/gem.mk"
|
||||
.include "../../mk/bsd.pkg.mk"
|
|
@ -0,0 +1,18 @@
|
|||
@comment $NetBSD$
|
||||
${GEM_HOME}/cache/${GEM_NAME}.gem
|
||||
${GEM_LIBDIR}/HISTORY.md
|
||||
${GEM_LIBDIR}/LICENSE
|
||||
${GEM_LIBDIR}/README.md
|
||||
${GEM_LIBDIR}/lib/sanitize.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/config.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/config/basic.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/config/relaxed.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/config/restricted.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/transformers/clean_cdata.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/transformers/clean_comment.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/transformers/clean_element.rb
|
||||
${GEM_LIBDIR}/lib/sanitize/version.rb
|
||||
${GEM_LIBDIR}/test/test_sanitize.rb
|
||||
${GEM_HOME}/specifications/${GEM_NAME}.gemspec
|
||||
@pkgdir lib/ruby/gems/2.6.0/extensions
|
||||
@pkgdir lib/ruby/gems/2.6.0/build_info
|
|
@ -0,0 +1,6 @@
|
|||
$NetBSD$
|
||||
|
||||
SHA1 (sanitize-2.1.1.gem) = 8a4b56b6d06a52da3fa389a0e1c20ff9ad487a2b
|
||||
RMD160 (sanitize-2.1.1.gem) = f9c4e226e1cac3681a86a1af763c155e02c92a7d
|
||||
SHA512 (sanitize-2.1.1.gem) = 1fdab0c67d5668b6a1a978ad649a91f3af66797b5fe3282d80535962a66c23ec56a4520b46e2f6793cac55785b17e5ee9f60616cd5e613f8f986abc6fe5ff71f
|
||||
Size (sanitize-2.1.1.gem) = 22528 bytes
|
Loading…
Reference in New Issue