0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-08 23:08:42 +00:00
Commit Graph

66 Commits

Author SHA1 Message Date
Edward Z. Yang
f63e870300 Quality control, improve a little documentation and fix UTF-8 unfriendliness in the Generator.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@138 48356398-32a2-884e-a903-53898d9a118a
2006-08-01 00:29:38 +00:00
Edward Z. Yang
79e5cd4543 Augment test file so we can run from cli.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@137 48356398-32a2-884e-a903-53898d9a118a
2006-08-01 00:18:22 +00:00
Edward Z. Yang
9d411bd5cc - Implement double-checking in Strategy/FixNesting.php, fixes the table bugs.
- Move around child definitions so they make a little more sense (rename to Custom) and also add $allow_empty property to help FixNesting.php determine whether or not to double-check.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@136 48356398-32a2-884e-a903-53898d9a118a
2006-07-31 03:04:57 +00:00
Edward Z. Yang
9c6ae16764 Massively refactored Definition, moved MakeWellFormed HTML specific code out.
Add table functionality for nesting, don't know how I missed that. It's still broken though.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@135 48356398-32a2-884e-a903-53898d9a118a
2006-07-31 00:15:01 +00:00
Edward Z. Yang
70bd80e66a Added ValidateAttributes strategy and associated unit tests. Amended Generator with some sanity checks. Made Definition include all necessary definitions. Note the two elements (bdo and br) that only use coreattrs.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@132 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 18:37:42 +00:00
Edward Z. Yang
bb0435bdd4 Add AttrDef_Id, as well as amend the accumulator by adding a load.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@131 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 16:35:05 +00:00
Edward Z. Yang
bba0d0b77a Remove Singleton functionality, the accumulator will just have to be passed around.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@130 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 16:01:24 +00:00
Edward Z. Yang
4ab930dab4 Add IDAccumulator.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@129 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 15:52:25 +00:00
Edward Z. Yang
f8eaedb500 Factor out definitions to a ['child'] so that we could assign the ['attr'] definitions separately.
Also, added AttrDef/EnumTest.php

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@127 48356398-32a2-884e-a903-53898d9a118a
2006-07-30 00:54:38 +00:00
Edward Z. Yang
9b7ad89ab5 - Added Composite and Core strategies.
- Added generate_mock() function for testing
- Factored out inputs/output tests to StrategyAbstractTest

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@124 48356398-32a2-884e-a903-53898d9a118a
2006-07-29 17:38:28 +00:00
Edward Z. Yang
619d5d9bc1 Migrate strategies to separate classes complete.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@119 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:49:37 +00:00
Edward Z. Yang
f75e8dab8c Extract FixNestingTest from DefinitionTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@118 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:43:53 +00:00
Edward Z. Yang
63396bb076 Extract MakeWellFormedTest from DefinitionTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@117 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:41:06 +00:00
Edward Z. Yang
4c200f6bcb Extract RemoveForeignElementsTest from Definition.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@116 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:33:07 +00:00
Edward Z. Yang
e768f845f4 Extract common functionality to StrategyAbstractTest.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@115 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 02:28:40 +00:00
Edward Z. Yang
dfb3d48397 Migrate DefinitionTest to use DirectLex for easier to read test-cases.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@109 48356398-32a2-884e-a903-53898d9a118a
2006-07-24 01:22:51 +00:00
Edward Z. Yang
609977f9f5 Add CDATA support to the Lexers, as well as give PEARSax3 entity replacement.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@106 48356398-32a2-884e-a903-53898d9a118a
2006-07-23 23:04:34 +00:00
Edward Z. Yang
5ce0ae7056 Implement EntityLookup and put in the Lexer. Some behavior was migrated, since it looks like it will have to be used in all Lexers, not just DirectLex (which is the only one that uses it).
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@105 48356398-32a2-884e-a903-53898d9a118a
2006-07-23 21:07:30 +00:00
Edward Z. Yang
2fa1161d3d - Implemented special entity conversion.
- Optimized and documented DirectLex.
- Rearranged test cases.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@100 48356398-32a2-884e-a903-53898d9a118a
2006-07-23 18:13:04 +00:00
Edward Z. Yang
14f481bcf6 svn:eol-style = native
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@97 48356398-32a2-884e-a903-53898d9a118a
2006-07-23 00:11:03 +00:00
Edward Z. Yang
042eda0463 Hook new test file in and delete duplicated tests.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@95 48356398-32a2-884e-a903-53898d9a118a
2006-07-23 00:03:11 +00:00
Edward Z. Yang
6a5ff6d2a9 Branch the LexerTest in order to partition DirectLex specific unit tests.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@94 48356398-32a2-884e-a903-53898d9a118a
2006-07-23 00:01:11 +00:00
Edward Z. Yang
ca1aefe271 Commit various optimizations to the Lexer, and add stub file for profiling the lexer.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@92 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 22:48:07 +00:00
Edward Z. Yang
de5ab5e6a0 Kick the auto-prepend habit.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@91 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 19:01:59 +00:00
Edward Z. Yang
ac1e62e043 Optimize next*() functions in DirectLex, add test for offset. Update Lexer documents.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@90 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 18:55:34 +00:00
Edward Z. Yang
eac83995e1 Remove dud test file.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@89 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 16:04:22 +00:00
Edward Z. Yang
1ab3ae160a Move classes into Zend style setup.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@88 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 15:38:41 +00:00
Edward Z. Yang
f0d74a3bf4 Fix parse error in PHP4.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@81 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 14:00:52 +00:00
Edward Z. Yang
4bf3305dff Build another lexer from PHP5's DOM library. Extremely fast!
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@80 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 13:50:05 +00:00
Edward Z. Yang
3e982c7f2c Rename Lexer, separate files. Also augmented benchmarks and benchmarker,
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@79 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 12:53:04 +00:00
Edward Z. Yang
cafa24482d Setup include web. Unit tests should now be able to be run independently.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@75 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:13:08 +00:00
Edward Z. Yang
025b648c99 Split out code in Definition.php .
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@73 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:02:48 +00:00
Edward Z. Yang
f00a80c561 (Test) Branch Definition to ChildDef in order to split out code in the file.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@72 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 00:01:38 +00:00
Edward Z. Yang
404ca68c87 Rename PureHTMLDefinition -> HTMLPurifier_Definition, and internal classes too.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@69 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:38:44 +00:00
Edward Z. Yang
436873e227 Move tester, complete HTML_Purifier -> HTMLPurifier move.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@68 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:27:00 +00:00
Edward Z. Yang
1836b73c63 HTML_Purifier to HTMLPurifier. May want to rethink schematics for this though.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@67 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:13:22 +00:00
Edward Z. Yang
ccebe77e70 Rename HTML_Generator to HTMLPurifier_Generator.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@66 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:10:30 +00:00
Edward Z. Yang
6a6afaccc5 Rename HTML_Lexer to HTMLPurifier_Lexer. However, some more refactoring still needs to be done (namely making the lexer an interface).
Also fixed broken benchmarks.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@65 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 23:07:47 +00:00
Edward Z. Yang
23dba8b55e Rename MarkupFragment.php to Token.php, change internal class names and rewire the classes. We also started adding more dependence on the Lexer and Generator in unrelated tests.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@63 48356398-32a2-884e-a903-53898d9a118a
2006-07-21 11:27:54 +00:00
Edward Z. Yang
3427c6c079 Begin getting parsing of character data into shape, not done yet.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@60 48356398-32a2-884e-a903-53898d9a118a
2006-07-20 02:43:06 +00:00
Edward Z. Yang
ff8f24458d Finish implementing fixNesting(). Removed security-in-depth check for optimization reasons, since the info array will never cause such a condition.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@58 48356398-32a2-884e-a903-53898d9a118a
2006-07-20 00:30:35 +00:00
Edward Z. Yang
3e6bcb7a0f Implemented good behavior structure for fixNesting. Goes into infinite loop if bad stuff is passed.
Remove dud test and note which tests need to be added. Also, we're only running one test at a time to ease debugging.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@57 48356398-32a2-884e-a903-53898d9a118a
2006-07-19 00:21:21 +00:00
Edward Z. Yang
5391195170 Finalize fixNesting test suite.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@55 48356398-32a2-884e-a903-53898d9a118a
2006-07-18 23:17:41 +00:00
Edward Z. Yang
06798e60f2 Move Test_HTMLDTD_ChildDef to top for improved organization.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@54 48356398-32a2-884e-a903-53898d9a118a
2006-07-15 20:50:28 +00:00
Edward Z. Yang
d9c8effc9b Begin fleshing out test_fixNesting(). Still needs more test-cases.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@52 48356398-32a2-884e-a903-53898d9a118a
2006-06-11 22:53:40 +00:00
Edward Z. Yang
4935c69904 Main: implemented regexp-style validation for complicated child definitions
Also:
* Updated spec with some extra comments
* Trigger error if HTMLDTD_ChildDef_Simple has validateChildren called
* Factor out definition assertion in test class

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@50 48356398-32a2-884e-a903-53898d9a118a
2006-06-05 00:50:27 +00:00
Edward Z. Yang
f5486bbbae Add ChildDef_Optional, which piggy-backs off of ChildDef_Required. Some column 80 formatting fixes.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@49 48356398-32a2-884e-a903-53898d9a118a
2006-05-30 22:44:14 +00:00
Edward Z. Yang
83f735ea7e Finish HTMLDTD_ChildDef_Required.
Fix bug in HTML_Generator that resulted in attribute-less empty elements to have extra spaces in them.

Add whitespace designation to MF_Text.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@44 48356398-32a2-884e-a903-53898d9a118a
2006-04-17 00:49:15 +00:00
Edward Z. Yang
b29155018b Add a few more comments about possible extra features.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@42 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 21:06:08 +00:00
Edward Z. Yang
8c80b70c37 Implement automatic <p> and <li> closing. We trimmed down the closing P tags list to something more sane in the spec.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@41 48356398-32a2-884e-a903-53898d9a118a
2006-04-16 19:34:28 +00:00