mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +00:00
[2.0.1] Rewire line numbering so that if it's null it's autodetected based on error collection. also, update TODO.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1237 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
6f5592ae60
commit
98b4e70a93
4
TODO
4
TODO
@ -10,6 +10,7 @@ TODO List
|
|||||||
2.1 release [Refactor, refactor!]
|
2.1 release [Refactor, refactor!]
|
||||||
# URI validation routines tighter (see docs/dev-code-quality.html) (COMPLEX)
|
# URI validation routines tighter (see docs/dev-code-quality.html) (COMPLEX)
|
||||||
# Advanced URI filtering schemes (see docs/proposal-new-directives.txt)
|
# Advanced URI filtering schemes (see docs/proposal-new-directives.txt)
|
||||||
|
# Ruby support
|
||||||
- Configuration profiles: predefined directives set with one func call
|
- Configuration profiles: predefined directives set with one func call
|
||||||
- Implement IDREF support (harder than it seems, since you cannot have
|
- Implement IDREF support (harder than it seems, since you cannot have
|
||||||
IDREFs to non-existent IDs)
|
IDREFs to non-existent IDs)
|
||||||
@ -17,7 +18,6 @@ TODO List
|
|||||||
|
|
||||||
2.2 release [Error'ed]
|
2.2 release [Error'ed]
|
||||||
# Error logging for filtering/cleanup procedures
|
# Error logging for filtering/cleanup procedures
|
||||||
- Requires I18N facilities to be created first (COMPLEX)
|
|
||||||
- XSS-attempt detection
|
- XSS-attempt detection
|
||||||
|
|
||||||
2.3 release [Do What I Mean, Not What I Say]
|
2.3 release [Do What I Mean, Not What I Say]
|
||||||
@ -45,7 +45,6 @@ TODO List
|
|||||||
same fashion!)
|
same fashion!)
|
||||||
# Formatters for plaintext
|
# Formatters for plaintext
|
||||||
- Smileys
|
- Smileys
|
||||||
- Linkification for HTML Purifier docs: classes
|
|
||||||
- Standardize token armor for all areas of processing
|
- Standardize token armor for all areas of processing
|
||||||
- Fixes for Firefox's inability to handle COL alignment props (Bug 915)
|
- Fixes for Firefox's inability to handle COL alignment props (Bug 915)
|
||||||
- Automatically add non-breaking spaces to empty table cells when
|
- Automatically add non-breaking spaces to empty table cells when
|
||||||
@ -58,7 +57,6 @@ TODO List
|
|||||||
- Hooks for adding custom processors to custom namespaced tags and
|
- Hooks for adding custom processors to custom namespaced tags and
|
||||||
attributes, offer default implementation
|
attributes, offer default implementation
|
||||||
- Lots of documentation and samples
|
- Lots of documentation and samples
|
||||||
- XHTML 1.1 support
|
|
||||||
|
|
||||||
Ongoing
|
Ongoing
|
||||||
- Lots of profiling, make it faster!
|
- Lots of profiling, make it faster!
|
||||||
|
@ -65,7 +65,8 @@ class HTMLPurifier_ErrorCollector
|
|||||||
$errors = $this->errors;
|
$errors = $this->errors;
|
||||||
|
|
||||||
// sort error array by line
|
// sort error array by line
|
||||||
if ($config->get('Core', 'MaintainLineNumbers')) {
|
// line numbers are enabled if they aren't explicitly disabled
|
||||||
|
if ($config->get('Core', 'MaintainLineNumbers') !== false) {
|
||||||
$lines = array();
|
$lines = array();
|
||||||
foreach ($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
$lines[] = $error[0];
|
$lines[] = $error[0];
|
||||||
|
@ -54,14 +54,15 @@ HTMLPurifier_ConfigSchema::define(
|
|||||||
);
|
);
|
||||||
|
|
||||||
HTMLPurifier_ConfigSchema::define(
|
HTMLPurifier_ConfigSchema::define(
|
||||||
'Core', 'MaintainLineNumbers', false, 'bool', '
|
'Core', 'MaintainLineNumbers', null, 'bool/null', '
|
||||||
<p>
|
<p>
|
||||||
If true, HTML Purifier will add line number information to all tokens.
|
If true, HTML Purifier will add line number information to all tokens.
|
||||||
This is useful when error reporting is turned on, but can result in
|
This is useful when error reporting is turned on, but can result in
|
||||||
significant performance degradation and should not be used when
|
significant performance degradation and should not be used when
|
||||||
unnecessary. This directive must be used with the DirectLex lexer,
|
unnecessary. This directive must be used with the DirectLex lexer,
|
||||||
as the DOMLex lexer does not (yet) support this functionality. This directive
|
as the DOMLex lexer does not (yet) support this functionality.
|
||||||
has been available since 2.0.0.
|
If the value is null, an appropriate value will be selected based
|
||||||
|
on other configuration. This directive has been available since 2.0.0.
|
||||||
</p>
|
</p>
|
||||||
');
|
');
|
||||||
|
|
||||||
|
@ -44,6 +44,13 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
|
|||||||
$array = array(); // result array
|
$array = array(); // result array
|
||||||
|
|
||||||
$maintain_line_numbers = $config->get('Core', 'MaintainLineNumbers');
|
$maintain_line_numbers = $config->get('Core', 'MaintainLineNumbers');
|
||||||
|
|
||||||
|
if ($maintain_line_numbers === null) {
|
||||||
|
// automatically determine line numbering by checking
|
||||||
|
// if error collection is on
|
||||||
|
$maintain_line_numbers = $config->get('Core', 'CollectErrors');
|
||||||
|
}
|
||||||
|
|
||||||
if ($maintain_line_numbers) $current_line = 1;
|
if ($maintain_line_numbers) $current_line = 1;
|
||||||
else $current_line = false;
|
else $current_line = false;
|
||||||
$context->register('CurrentLine', $current_line);
|
$context->register('CurrentLine', $current_line);
|
||||||
|
Loading…
Reference in New Issue
Block a user