diff --git a/NEWS b/NEWS index 2796a1c4..903f8f6f 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,9 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier # HTMLPurifier_Config will now throw E_USER_NOTICE when you use a directive alias; to get rid of these errors just modify your configuration to use the new directive name. +# HTMLPurifier->addFilter is deprecated; built-in filters can now be + enabled using %Filter.$filter_name or by setting your own filters using + %Filter.Custom # Directive-level safety properties superceded in favor of module-level safety. Internal method HTMLModule->addElement() has changed, although the externally visible HTMLDefinition->addElement has *not* changed. diff --git a/TODO b/TODO index 5fedfa70..c6addc81 100644 --- a/TODO +++ b/TODO @@ -22,7 +22,6 @@ DOCUMENTATION - Update French translation of README IMPORTANT FEATURES - - Get everything into configuration objects (filters, I'm looking at you) - Factor out command line parser into its own class, and unit test it - Figure out autoload and PEAR diff --git a/configdoc/styles/plain.xsl b/configdoc/styles/plain.xsl index c98bcc2f..72e4c8b8 100644 --- a/configdoc/styles/plain.xsl +++ b/configdoc/styles/plain.xsl @@ -216,5 +216,18 @@
+ This directive can be used to add custom filters; it is nearly the
+ equivalent of the now deprecated HTMLPurifier->addFilter()
+ method. Specify an array of concrete implementations.
+
+ This directive turns on the style block extraction filter, which removes
+ style
blocks from input HTML, cleans them up with CSSTidy,
+ and places them in the StyleBlocks
context variable, for further
+ use by you, usually to be placed in an external stylesheet, or a
+ style
block in the head
of your document.
+
+ Sample usage: +
+set('Filter', 'ExtractStyleBlocks', true); +$purifier = new HTMLPurifier($config); +$styles = $purifier->context->get('StyleBlocks'); +foreach ($styles as $style) { + echo '\n"; +}]]>diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt new file mode 100644 index 00000000..cbdc0068 --- /dev/null +++ b/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt @@ -0,0 +1,10 @@ +Filter.YouTube +TYPE: bool +VERSION: 3.1.0 +DEFAULT: false +--DESCRIPTION-- +
+ This directive enables YouTube video embedding in HTML Purifier. Check + this document + on embedding videos for more information on what this filter does. +
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.txt index 0d6d93da..9fad43a8 100644 --- a/library/HTMLPurifier/ConfigSchema/schema/Filter.txt +++ b/library/HTMLPurifier/ConfigSchema/schema/Filter.txt @@ -1,2 +1,2 @@ Filter -DESCRIPTION: Configuration for filters +DESCRIPTION: Directives for turning filters on and off, or specifying custom filters. diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocksEscaping.txt b/library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksEscaping.txt similarity index 78% rename from library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocksEscaping.txt rename to library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksEscaping.txt index f2ca070e..d20010c7 100644 --- a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocksEscaping.txt +++ b/library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksEscaping.txt @@ -1,7 +1,8 @@ -Filter.ExtractStyleBlocksEscaping +FilterParam.ExtractStyleBlocksEscaping TYPE: bool VERSION: 3.0.0 DEFAULT: true +ALIASES: Filter.ExtractStyleBlocksEscaping --DESCRIPTION--diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocksScope.txt b/library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksScope.txt similarity index 91% rename from library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocksScope.txt rename to library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksScope.txt index 2e410d35..ec29078d 100644 --- a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocksScope.txt +++ b/library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksScope.txt @@ -1,7 +1,8 @@ -Filter.ExtractStyleBlocksScope +FilterParam.ExtractStyleBlocksScope TYPE: string/null VERSION: 3.0.0 DEFAULT: NULL +ALIASES: Filter.ExtractStyleBlocksScope --DESCRIPTION--
diff --git a/library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksTidyImpl.txt b/library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksTidyImpl.txt new file mode 100644 index 00000000..78e69cbb --- /dev/null +++ b/library/HTMLPurifier/ConfigSchema/schema/FilterParam.ExtractStyleBlocksTidyImpl.txt @@ -0,0 +1,14 @@ +FilterParam.ExtractStyleBlocksTidyImpl +TYPE: mixed/null +VERSION: 3.1.0 +DEFAULT: NULL +--DESCRIPTION-- +
+ If left NULL, HTML Purifier will attempt to instantiate a csstidy
+ class to use for internal cleaning. This will usually be good enough.
+
+ However, for trusted user input, you can set this to false
to
+ disable cleaning. In addition, you can supply your own concrete implementation
+ of Tidy's interface to use, although I don't know why you'd want to do that.
+